ffmpeg | branch: master | Vittorio Giovara <vittorio.giov...@gmail.com> | Fri 
Jan 23 15:03:08 2015 +0000| [7c51d79ca7badfb370c410b8f44c9142b938e2e6] | 
committer: Vittorio Giovara

nsvdec: validate channels and samplerate

Avoid a division by zero.

CC: libav-sta...@libav.org
Bug-Id: CID 717749

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7c51d79ca7badfb370c410b8f44c9142b938e2e6
---

 libavformat/nsvdec.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/nsvdec.c b/libavformat/nsvdec.c
index 670b867..5662279 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) {

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

Reply via email to