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>
(cherry picked from commit 4f1279154e)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
75211f2b8c
commit
811a504c6b
1 changed files with 1 additions and 0 deletions
|
|
@ -343,6 +343,7 @@ static int read_header(ShortenContext *s)
|
|||
s->channels = get_uint(s, CHANSIZE);
|
||||
if (s->channels <= 0 || s->channels > MAX_CHANNELS) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "too many channels: %d\n", s->channels);
|
||||
s->channels = 0;
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
s->avctx->channels = s->channels;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue