summaryrefslogtreecommitdiff
path: root/libavcodec/shorten.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2012-10-23 00:40:51 -0400
committerJustin Ruggles <justin.ruggles@gmail.com>2012-11-01 11:29:18 -0400
commit4c53f4aed3edfa58360c7a2a468782eae31d3176 (patch)
tree42163011033b7216599d940c8f54d652268c4b66 /libavcodec/shorten.c
parent4e13e50432bd1c1a89f626f8196b55a0302c8f19 (diff)
shorten: validate that the channel count in the header is not <= 0
Diffstat (limited to 'libavcodec/shorten.c')
-rw-r--r--libavcodec/shorten.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c
index 1664a907ae..be2b8e20e9 100644
--- a/libavcodec/shorten.c
+++ b/libavcodec/shorten.c
@@ -342,7 +342,7 @@ static int read_header(ShortenContext *s)
s->internal_ftype = get_uint(s, TYPESIZE);
s->channels = get_uint(s, CHANSIZE);
- if (s->channels > MAX_CHANNELS) {
+ if (s->channels <= 0 || s->channels > MAX_CHANNELS) {
av_log(s->avctx, AV_LOG_ERROR, "too many channels: %d\n", s->channels);
return -1;
}