aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2012-10-23 00:40:51 -0400
committerReinhard Tartler <siretart@tauware.de>2013-05-09 11:28:25 +0200
commitd785f6940144eb6ce4c24309ed034056b81395bc (patch)
tree68001f35cac0b3033b7ec09ae91ca16123eefa50
parent5bfa208e6565fdea62898080b8fecbbd799d1454 (diff)
downloadffmpeg-d785f6940144eb6ce4c24309ed034056b81395bc.tar.gz
shorten: validate that the channel count in the header is not <= 0
(cherry picked from commit 4c53f4aed3edfa58360c7a2a468782eae31d3176) Signed-off-by: Reinhard Tartler <siretart@tauware.de> Conflicts: 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 b8c1908357..cb3d09dea1 100644
--- a/libavcodec/shorten.c
+++ b/libavcodec/shorten.c
@@ -342,7 +342,7 @@ static int shorten_decode_frame(AVCodecContext *avctx,
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;
}