]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/mjpegenc_huffman: Assert length in ff_mjpegenc_huffman_compute_bits()
authorMichael Niedermayer <michael@niedermayer.cc>
Sat, 8 Apr 2017 01:34:44 +0000 (03:34 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Mon, 10 Apr 2017 11:11:15 +0000 (13:11 +0200)
This should help coverity see that the issues this leads to cannot occur

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/mjpegenc_huffman.c

index ebf1311466132961ebbc132cd0ce14961c7d563a..0e63f8066b55f981e00475b47153872d753195cb 100644 (file)
@@ -87,6 +87,8 @@ void ff_mjpegenc_huffman_compute_bits(PTable *prob_table, HuffTable *distincts,
 
     int min;
 
+    av_assert0(max_length > 0);
+
     to->nitems = 0;
     from->nitems = 0;
     to->item_idx[0] = 0;