[FFmpeg-devel] [PATCH]Avoid non-strict pointer aliasing in kega decoder
Reimar Döffinger
Reimar.Doeffinger at gmx.de
Mon Mar 4 09:43:16 CET 2013
Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:
>Reimar Döffinger <Reimar.Doeffinger <at> gmx.de> writes:
>
>> >>> Attached patch fixes the fate failure for icc 13.1
>> >
>> >> Apart from that, when I suggested memcpy I meant replacing
>> >> the whole for loop by a single memcpy, no need to
>> >> copy the pixels one by one.
>> >
>> > That failed for me with gcc, could you suggest how to do it
>> > correctly?
>>
>> What do you mean by 'failed' and what did you try?
>
>With my current patch, the for loop looks like this:
> for (i = inp_off; i < count + inp_off; i++) {
> memcpy(&out[2 * outcnt++], &inp[2 * i], 2);
> }
>
>When I change that to memcpy:
> memcpy(&out[2 * outcnt], &inp[2 * inp_off], 2 * count);
> outcnt += count;
>
>I see ugly artefacts.
Maybe inp and out can overlap? Try memmove.
Though that might not be enough, something like our copy_backptr function might be needed.
Probably needs a closer look at the code.
More information about the ffmpeg-devel
mailing list