[FFmpeg-cvslog] mjpegdec: properly report unsupported disabled features
Luca Barbato
git at videolan.org
Thu May 16 17:17:01 CEST 2013
ffmpeg | branch: master | Luca Barbato <lu_zero at gentoo.org> | Tue May 14 15:27:26 2013 +0200| [b25e49b187617c486ae3f50a5cbb356fc0e868bb] | committer: Luca Barbato
mjpegdec: properly report unsupported disabled features
When JPEG-LS support is disabled the decoder would feed the
data to the JPEG Lossless decode_*_scan function resulting in
faulty decoding.
CC: libav-stable at libav.org
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b25e49b187617c486ae3f50a5cbb356fc0e868bb
---
libavcodec/mjpegdec.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 61ebabc..ef46c5f 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -1485,6 +1485,12 @@ int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
else if (start_code == COM)
mjpeg_decode_com(s);
+ if (!CONFIG_JPEGLS_DECODER &&
+ (start_code == SOF48 || start_code == LSE)) {
+ av_log(avctx, AV_LOG_ERROR, "JPEG-LS support not enabled.\n");
+ return AVERROR(ENOSYS);
+ }
+
switch (start_code) {
case SOI:
s->restart_interval = 0;
More information about the ffmpeg-cvslog
mailing list