[FFmpeg-cvslog] avcodec/mjpegdec: Check initializing Huffman tables

Andreas Rheinhardt git at videolan.org
Sat Apr 3 19:09:47 EEST 2021


ffmpeg | branch: release/4.4 | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Sat Apr  3 16:00:56 2021 +0200| [54dd729cee280b9c865986e3c19ebfeff98a4398] | committer: Andreas Rheinhardt

avcodec/mjpegdec: Check initializing Huffman tables

Reviewed-by: Michael Niedermayer <michael at niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
(cherry picked from commit d5ddfec6c3ce0ff743e3d67c42a1a59d3afe8e8c)

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

 libavcodec/mjpegdec.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index fd6a4eeb76..e4e0c26df9 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -154,7 +154,8 @@ av_cold int ff_mjpeg_decode_init(AVCodecContext *avctx)
         if (ff_mjpeg_decode_dht(s)) {
             av_log(avctx, AV_LOG_ERROR,
                    "error using external huffman table, switching back to internal\n");
-            init_default_huffman_tables(s);
+            if ((ret = init_default_huffman_tables(s)) < 0)
+                return ret;
         }
     }
     if (avctx->field_order == AV_FIELD_BB) { /* quicktime icefloe 019 */



More information about the ffmpeg-cvslog mailing list