Skip to content

Commit

Permalink
shorten: set invalid channels count to 0
Browse files Browse the repository at this point in the history
Prevent the loop shorten_decode_close from writing and freeing out of
the array boundary.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
  • Loading branch information
michaelni authored and lu-zero committed Mar 6, 2013
1 parent 02055b6 commit c10da30
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions libavcodec/shorten.c
Expand Up @@ -341,6 +341,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 -1;
}
s->avctx->channels = s->channels;
Expand Down

0 comments on commit c10da30

Please sign in to comment.