[FFmpeg-devel] Possible array overflow in libavcodec/adpcm.c

Philipp Thomas pth at suse.de
Wed Mar 21 19:45:21 CET 2012

gcc 4.7 warns of a possible array overflow in said file. And
adpcm_decode_frame has 

        for (i = 0; i < 4; i++)
            prev[0][i] = (int16_t)bytestream_get_be16(&src);

Where prev is defined as int[2][2]. If you look a bit above, you see

        for (i = 0; i < 32; i++)
            table[0][i] = (int16_t)bytestream_get_be16(&src);

Where table is defined int[2]16]. Both look to me as dirty hacks assuming
a fixed memory layout which I doubt is sane. Any reasons why not to change
that into two nested loops that initialize prev and table?


More information about the ffmpeg-devel mailing list