[FFmpeg-cvslog] avcodec/mjpegenc_huffman: Assert length in ff_mjpegenc_huffman_compute_bits()
Michael Niedermayer
git at videolan.org
Wed Apr 12 01:01:31 EEST 2017
ffmpeg | branch: release/3.3 | Michael Niedermayer <michael at niedermayer.cc> | Sat Apr 8 03:34:44 2017 +0200| [0c188bc595c1ebcfaf3e0314df1cad30446851d2] | committer: Michael Niedermayer
avcodec/mjpegenc_huffman: Assert length in ff_mjpegenc_huffman_compute_bits()
This should help coverity see that the issues this leads to cannot occur
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 8dd0c12648d838bb982ca10f384ee1f0107dfece)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0c188bc595c1ebcfaf3e0314df1cad30446851d2
---
libavcodec/mjpegenc_huffman.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libavcodec/mjpegenc_huffman.c b/libavcodec/mjpegenc_huffman.c
index ebf1311466..0e63f8066b 100644
--- a/libavcodec/mjpegenc_huffman.c
+++ b/libavcodec/mjpegenc_huffman.c
@@ -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;
More information about the ffmpeg-cvslog
mailing list