mirror of
https://mirror.skon.top/https://github.com/FFmpeg/FFmpeg
synced 2026-05-01 06:13:08 +08:00
avcodec/magicyuv: Check early for invalid slices
Every plane of each slice has to contain at least two bytes for flags and the type of prediction used. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
@@ -614,6 +614,8 @@ static int magy_decode_frame(AVCodecContext *avctx, void *data,
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
s->slices[i][j].size = next_offset - offset;
|
||||
if (s->slices[i][j].size < 2)
|
||||
return AVERROR_INVALIDDATA;
|
||||
offset = next_offset;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user