On Tue, May 14, 2013 at 03:31:56PM +0200, Luca Barbato wrote:
> 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]
> ---
>  libavcodec/mjpegdec.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
> index 5b44a49..83b40d9 100644
> --- a/libavcodec/mjpegdec.c
> +++ b/libavcodec/mjpegdec.c
> @@ -1492,6 +1492,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;
> -- 

looks OK though Diego might want to improve the message
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to