diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2013-05-14 15:27:26 +0200 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2013-05-16 14:05:46 +0200 |
commit | b25e49b187617c486ae3f50a5cbb356fc0e868bb (patch) | |
tree | 2d7a25e446df89db47cd312da6f347e40f6a401f /libavcodec/mjpegdec.c | |
parent | 3062ac4c47b18305aa55788133b4c8aaded12f11 (diff) | |
download | ffmpeg-b25e49b187617c486ae3f50a5cbb356fc0e868bb.tar.gz |
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@libav.org
Diffstat (limited to 'libavcodec/mjpegdec.c')
-rw-r--r-- | libavcodec/mjpegdec.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 61ebabc77d..ef46c5f2a2 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; |