Avoid a division by zero.

CC: [email protected]
Bug-Id: CID 717749
---
 libavformat/nsvdec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/nsvdec.c b/libavformat/nsvdec.c
index 1c3cade..864da1d 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) {
-- 
1.9.3 (Apple Git-50)

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to