ok

On 9/12/19, Michael Niedermayer <mich...@niedermayer.cc> wrote:
> Fixes: out of array write
> Fixes:
> 17088/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEGLS_fuzzer-5654877765632000
>
> Found-by: continuous fuzzing process
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc>
> ---
>  libavcodec/mjpegdec.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
> index 5a80b7d289..f095afaed8 100644
> --- a/libavcodec/mjpegdec.c
> +++ b/libavcodec/mjpegdec.c
> @@ -1071,6 +1071,10 @@ static int ljpeg_decode_rgb_scan(MJpegDecodeContext
> *s, int nb_components, int p
>      int resync_mb_x = 0;
>      int vpred[6];
>
> +    if (!s->bayer && s->nb_components < 3)
> +        return AVERROR_INVALIDDATA;
> +    if (s->bayer && s->nb_components > 2)
> +        return AVERROR_INVALIDDATA;
>      if (s->nb_components <= 0 || s->nb_components > 4)
>          return AVERROR_INVALIDDATA;
>      if (s->v_max != 1 || s->h_max != 1 || !s->lossless)
> --
> 2.23.0
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to