summaryrefslogtreecommitdiff
path: root/libavcodec/twinvq.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2012-10-23 13:15:24 -0400
committerJustin Ruggles <justin.ruggles@gmail.com>2012-11-01 11:29:19 -0400
commit8cc72ce5a0d8ab6bc88d28cf55cd62674240121d (patch)
tree91f4ae9b2be1a9a5506c03999216b995249f1708 /libavcodec/twinvq.c
parentcebea00c8abac0817d3ae8bdd9573a603c655b75 (diff)
twinvq: validate that channels is not <= 0
This could occur due to integer overflow when reading the channel count from the extradata.
Diffstat (limited to 'libavcodec/twinvq.c')
-rw-r--r--libavcodec/twinvq.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/twinvq.c b/libavcodec/twinvq.c
index d009196445..50ee6266b3 100644
--- a/libavcodec/twinvq.c
+++ b/libavcodec/twinvq.c
@@ -1126,7 +1126,7 @@ static av_cold int twin_decode_init(AVCodecContext *avctx)
default: avctx->sample_rate = isampf * 1000; break;
}
- if (avctx->channels > CHANNELS_MAX) {
+ if (avctx->channels <= 0 || avctx->channels > CHANNELS_MAX) {
av_log(avctx, AV_LOG_ERROR, "Unsupported number of channels: %i\n",
avctx->channels);
return -1;