Commit 25d9643f authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/mjpegdec: Check for rgb before flipping

Fixes assertion failure due to unsupported case

Fixes: 356/fuzz-1-ffmpeg_VIDEO_AV_CODEC_ID_MJPEG_fuzzer
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent ec2f3b1f
...@@ -2386,7 +2386,7 @@ the_end: ...@@ -2386,7 +2386,7 @@ the_end:
} }
} }
} }
if (s->flipped) { if (s->flipped && !s->rgb) {
int j; int j;
avcodec_get_chroma_sub_sample(s->avctx->pix_fmt, &hshift, &vshift); avcodec_get_chroma_sub_sample(s->avctx->pix_fmt, &hshift, &vshift);
av_assert0(s->nb_components == av_pix_fmt_count_planes(s->picture_ptr->format)); av_assert0(s->nb_components == av_pix_fmt_count_planes(s->picture_ptr->format));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment