[FFmpeg-devel] [PATCH]Avoid non-strict pointer aliasing in kega decoder

Carl Eugen Hoyos cehoyos at ag.or.at
Mon Mar 4 09:25:10 CET 2013


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.

Carl Eugen



More information about the ffmpeg-devel mailing list