1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02: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:
Michael Niedermayer 2013-02-13 01:03:30 +01:00
parent e1219cdaf9
commit 4f1279154e

View File

@ -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;