diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-02-13 01:03:30 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-02-13 01:04:20 +0100 |
commit | 4f1279154ee9baf2078241bf5619774970d18b25 (patch) | |
tree | dfaaebd318faf9d9db56b48872f1dfdf2ba9564f /libavcodec/shorten.c | |
parent | e1219cdaf9fb4bc8cea410e1caf802373c1bfe51 (diff) | |
download | ffmpeg-4f1279154ee9baf2078241bf5619774970d18b25.tar.gz |
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>
Diffstat (limited to 'libavcodec/shorten.c')
-rw-r--r-- | libavcodec/shorten.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c index 804dac7558..3dda56f766 100644 --- a/libavcodec/shorten.c +++ b/libavcodec/shorten.c @@ -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; |