On 03/09/13 13:24, Martin Storsjö wrote:
> From: Michael Niedermayer <[email protected]>
> 
> Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
> CC: [email protected]
> ---
>  libavcodec/mjpegdec.c |    6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
> index 7bca899..6048e1e 100644
> --- a/libavcodec/mjpegdec.c
> +++ b/libavcodec/mjpegdec.c
> @@ -242,6 +242,12 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
>      if (nb_components <= 0 ||
>          nb_components > MAX_COMPONENTS)
>          return -1;
> +    if (s->interlaced && (s->bottom_field == !s->interlace_polarity)) {
> +        if (nb_components != s->nb_components) {
> +            av_log(s->avctx, AV_LOG_ERROR, "nb_components changing in 
> interlaced picture\n");

maybe the text could stay in a separate line.

> +            return AVERROR_INVALIDDATA;
> +        }
> +    }
>      if (s->ls && !(s->bits <= 8 || nb_components == 1)) {
>          avpriv_report_missing_feature(s->avctx,
>                                        "JPEG-LS that is not <= 8 "
> 

The rest seems ok.

lu
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to