[Ffmpeg-devel] imgresample.c possible loop counter error?

Michael Niedermayer michaelni
Mon Oct 23 00:49:53 CEST 2006


Hi

On Mon, Oct 23, 2006 at 08:27:53AM +1100, Steven Johnson wrote:
> Hi,
> 
> In imgresample.c at around line 686, there is the following code:
> 
> 
>    uint8_t *buf1 = NULL, *buf2 = NULL;
>    enum PixelFormat current_pix_fmt;
> 
>    for (i = 0; i < 3; i++) {
>        src_pict.data[i] = src[i];
>        src_pict.linesize[i] = srcStride[i];
>        dst_pict.data[i] = dst[i];
> 
> Shouldn't the loop actually be <= 3, because the array's being 
> initialised have 4 entries each, not 3?  Otherwise src_pict.data[3] (and 
> the others) is uninitialised.
> 
> Or is this for a reason?

it should probably be 4 not 3 yes, but its not a big issue as the 4th
(alpha) plane is probably not used

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is




More information about the ffmpeg-devel mailing list