Module: libav Branch: release/0.8 Commit: a03dcec364747aea0c7e8c9fa2b5d00f5e799812
Author: Luca Barbato <[email protected]> Committer: Reinhard Tartler <[email protected]> Date: Tue May 14 15:27:26 2013 +0200 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: [email protected] (cherry picked from commit b25e49b187617c486ae3f50a5cbb356fc0e868bb) Signed-off-by: Reinhard Tartler <[email protected]> --- libavcodec/mjpegdec.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 542de98..18c52b9 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -1489,6 +1489,12 @@ int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *data_size, 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; _______________________________________________ libav-commits mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-commits
