mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
avcodec/magicyuv: Check that there are enough lines for interlacing to be possible
Fixes: out of array access Fixes: 20763/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MAGICYUV_fuzzer-5759562508664832 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit f8a0e9f9f71cf5650bdc250ff7475e0f7d8e8420) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
fa85195a94
commit
80d6a3c271
@ -673,6 +673,17 @@ static int magy_decode_frame(AVCodecContext *avctx, void *data,
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
if (s->interlaced) {
|
||||
if ((s->slice_height >> s->vshift[1]) < 2) {
|
||||
av_log(avctx, AV_LOG_ERROR, "impossible slice height\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
if ((avctx->coded_height % s->slice_height) && ((avctx->coded_height % s->slice_height) >> s->vshift[1]) < 2) {
|
||||
av_log(avctx, AV_LOG_ERROR, "impossible height\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < s->planes; i++) {
|
||||
av_fast_malloc(&s->slices[i], &s->slices_size[i], s->nb_slices * sizeof(Slice));
|
||||
if (!s->slices[i])
|
||||
|
Loading…
x
Reference in New Issue
Block a user