diff options
author | Michael Niedermayer <[email protected]> | 2013-02-13 01:03:30 +0100 |
---|---|---|
committer | Michael Niedermayer <[email protected]> | 2013-03-03 02:58:29 +0100 |
commit | 82213d67bad8785aef8806855fd0d291954193df (patch) | |
tree | 7c271fc6eb4df2e478098cf457b79d8e4089ebf0 | |
parent | d17b9469c940f056d87fefc79d80fac47c69c1d8 (diff) |
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 <[email protected]>
(cherry picked from commit 4f1279154ee9baf2078241bf5619774970d18b25)
Conflicts:
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 d04011e468..470b467b8c 100644 --- a/libavcodec/shorten.c +++ b/libavcodec/shorten.c @@ -342,6 +342,7 @@ static int read_header(ShortenContext *s) s->channels = get_uint(s, CHANSIZE); if (s->channels > MAX_CHANNELS) { av_log(s->avctx, AV_LOG_ERROR, "too many channels: %d\n", s->channels); + s->channels = 0; return -1; } s->avctx->channels = s->channels; |