mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-09-20 05:16:38 +00:00
avcodec/on2avc: Check number of channels
Fixes out of array access
Fixes: asan_heap-oob_4da4f3_7_asan_heap-oob_4da4f3_173_Xmen_avc_500.vp6
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 550f3e9df3
)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
1d99adc953
commit
84d26ab6eb
@ -908,6 +908,11 @@ static av_cold int on2avc_decode_init(AVCodecContext *avctx)
|
||||
On2AVCContext *c = avctx->priv_data;
|
||||
int i;
|
||||
|
||||
if (avctx->channels > 2U) {
|
||||
avpriv_request_sample(avctx, "Decoding more than 2 channels");
|
||||
return AVERROR_PATCHWELCOME;
|
||||
}
|
||||
|
||||
c->avctx = avctx;
|
||||
avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
|
||||
avctx->channel_layout = (avctx->channels == 2) ? AV_CH_LAYOUT_STEREO
|
||||
|
Loading…
Reference in New Issue
Block a user