mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-11 18:09:36 +00:00
shorten: dont leave invalid channel counts in the context.
Fixes freeing invalid addresses Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
e1219cdaf9
commit
4f1279154e
@ -343,6 +343,7 @@ static int read_header(ShortenContext *s)
|
|||||||
s->channels = get_uint(s, CHANSIZE);
|
s->channels = get_uint(s, CHANSIZE);
|
||||||
if (s->channels <= 0 || s->channels > MAX_CHANNELS) {
|
if (s->channels <= 0 || s->channels > MAX_CHANNELS) {
|
||||||
av_log(s->avctx, AV_LOG_ERROR, "too many channels: %d\n", s->channels);
|
av_log(s->avctx, AV_LOG_ERROR, "too many channels: %d\n", s->channels);
|
||||||
|
s->channels = 0;
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
s->avctx->channels = s->channels;
|
s->avctx->channels = s->channels;
|
||||||
|
Loading…
Reference in New Issue
Block a user