aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/nsvdec.c
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2015-01-23 15:03:08 +0000
committerVittorio Giovara <vittorio.giovara@gmail.com>2015-01-27 15:26:37 +0000
commit7c51d79ca7badfb370c410b8f44c9142b938e2e6 (patch)
treef1f0cd42084cee170ab4840bba2b7243df68f0ca /libavformat/nsvdec.c
parenta536a4e4bc52d05f59869761337452fb1f1977f6 (diff)
downloadffmpeg-7c51d79ca7badfb370c410b8f44c9142b938e2e6.tar.gz
nsvdec: validate channels and samplerate
Avoid a division by zero. CC: libav-stable@libav.org Bug-Id: CID 717749
Diffstat (limited to 'libavformat/nsvdec.c')
-rw-r--r--libavformat/nsvdec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/nsvdec.c b/libavformat/nsvdec.c
index 670b8678c8..5662279f79 100644
--- a/libavformat/nsvdec.c
+++ b/libavformat/nsvdec.c
@@ -620,6 +620,8 @@ null_chunk_retry:
bps = avio_r8(pb);
channels = avio_r8(pb);
samplerate = avio_rl16(pb);
+ if (!channels || !samplerate)
+ return AVERROR_INVALIDDATA;
asize-=4;
av_dlog(s, "NSV RAWAUDIO: bps %d, nchan %d, srate %d\n", bps, channels, samplerate);
if (fill_header) {