summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <[email protected]>2013-02-13 01:03:30 +0100
committerMichael Niedermayer <[email protected]>2013-03-03 02:58:29 +0100
commit82213d67bad8785aef8806855fd0d291954193df (patch)
tree7c271fc6eb4df2e478098cf457b79d8e4089ebf0
parentd17b9469c940f056d87fefc79d80fac47c69c1d8 (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.c1
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;