[FFmpeg-cvslog] mjpeg: treat external huffman table setup failure as codec init failure if external huffman table use requested

Dustin Brody git at videolan.org
Thu Sep 1 00:03:05 CEST 2011


ffmpeg | branch: master | Dustin Brody <libav at parsoma.net> | Thu Aug 25 19:47:01 2011 -0400| [a18e04bcf989a9d7f5629c573f9d70f8a020c7a7] | committer: Anton Khirnov

mjpeg: treat external huffman table setup failure as codec init failure if external huffman table use requested

Signed-off-by: Anton Khirnov <anton at khirnov.net>

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

 libavcodec/mjpegdec.c |    4 ++--
 libavcodec/mxpegdec.c |    4 +---
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 81effb4..b9db777 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -101,8 +101,8 @@ av_cold int ff_mjpeg_decode_init(AVCodecContext *avctx)
         av_log(avctx, AV_LOG_INFO, "mjpeg: using external huffman table\n");
         init_get_bits(&s->gb, avctx->extradata, avctx->extradata_size*8);
         if (ff_mjpeg_decode_dht(s)) {
-            av_log(avctx, AV_LOG_ERROR, "mjpeg: error using external huffman table, switching back to internal\n");
-            build_basic_mjpeg_vlc(s);
+            av_log(avctx, AV_LOG_ERROR, "mjpeg: error using external huffman table\n");
+            return AVERROR_INVALIDDATA;
         }
     }
     if (avctx->extradata_size > 9 &&
diff --git a/libavcodec/mxpegdec.c b/libavcodec/mxpegdec.c
index 92fd244..fd3fef4 100644
--- a/libavcodec/mxpegdec.c
+++ b/libavcodec/mxpegdec.c
@@ -47,9 +47,7 @@ static av_cold int mxpeg_decode_init(AVCodecContext *avctx)
 
     s->picture[0].reference = s->picture[1].reference = 3;
     s->jpg.picture_ptr      = &s->picture[0];
-    ff_mjpeg_decode_init(avctx);
-
-    return 0;
+    return ff_mjpeg_decode_init(avctx);
 }
 
 static int mxpeg_decode_app(MXpegDecodeContext *s,



More information about the ffmpeg-cvslog mailing list