summaryrefslogtreecommitdiff
path: root/libavformat/xvag.c
diff options
context:
space:
mode:
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2017-01-06 20:31:26 +0100
committerAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2017-01-30 01:40:48 +0100
commitcba4f0e97ecbbde7c71ec7a7ae3eb1469b34545b (patch)
treebb3f8b1870a4af24f948668a67897465dd2c39ec /libavformat/xvag.c
parent74bd17d31648c77d01a0d35b09724715bc40fba2 (diff)
xvag: prevent overflow during block alignment calculation
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Diffstat (limited to 'libavformat/xvag.c')
-rw-r--r--libavformat/xvag.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/xvag.c b/libavformat/xvag.c
index 5ef4fb0900..22e4f1e3c8 100644
--- a/libavformat/xvag.c
+++ b/libavformat/xvag.c
@@ -20,6 +20,7 @@
*/
#include "libavutil/bswap.h"
+#include "libavcodec/internal.h"
#include "avformat.h"
#include "internal.h"
@@ -68,7 +69,7 @@ static int xvag_read_header(AVFormatContext *s)
if (st->codecpar->sample_rate <= 0)
return AVERROR_INVALIDDATA;
- if (st->codecpar->channels <= 0)
+ if (st->codecpar->channels <= 0 || st->codecpar->channels > FF_SANE_NB_CHANNELS)
return AVERROR_INVALIDDATA;
switch (codec) {