Browse Source

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
tags/n2.0
Luca Barbato 12 years ago
parent
commit
b25e49b187
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      libavcodec/mjpegdec.c

+ 6
- 0
libavcodec/mjpegdec.c View File

@@ -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;


Loading…
Cancel
Save