[FFmpeg-cvslog] avcodec/bitstream: assert that no integer overflow happened when writing codes in build_table ()

Michael Niedermayer git at videolan.org
Thu Jan 23 02:03:51 CET 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Jan 23 01:32:49 2014 +0100| [622d463000371467cb0365744f0c1d92b56bed52] | committer: Michael Niedermayer

avcodec/bitstream: assert that no integer overflow happened when writing codes in build_table()

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=622d463000371467cb0365744f0c1d92b56bed52
---

 libavcodec/bitstream.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/bitstream.c b/libavcodec/bitstream.c
index 99119cd..e907322 100644
--- a/libavcodec/bitstream.c
+++ b/libavcodec/bitstream.c
@@ -232,6 +232,7 @@ static int build_table(VLC *vlc, int table_nb_bits, int nb_codes,
             /* note: realloc has been done, so reload tables */
             table = &vlc->table[table_index];
             table[j][0] = index; //code
+            av_assert0(table[j][0] == index);
             i = k-1;
         }
     }



More information about the ffmpeg-cvslog mailing list