mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-06-16 04:32:47 +02:00
avcodec/magicyuv: reject slice_height misaligned with chroma vshift
Fixes: poc_magicyuv.avi
Fixes: out of array access
Found-by: Ori Hollander of the JFrog Vulnerability Research team
(cherry picked from commit 374b726ffa)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
committed by
Michael Niedermayer
parent
e302bafe79
commit
9516e6900a
@@ -554,6 +554,13 @@ static int magy_decode_frame(AVCodecContext *avctx, AVFrame *p,
|
||||
"invalid slice height: %d\n", s->slice_height);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
if (s->vshift[1] && (s->slice_height & ((1 << s->vshift[1]) - 1))) {
|
||||
av_log(avctx, AV_LOG_ERROR,
|
||||
"slice_height %d is not aligned to chroma vertical "
|
||||
"subsampling (must be a multiple of %d)\n",
|
||||
s->slice_height, 1 << s->vshift[1]);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
bytestream2_skipu(&gb, 4);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user