]> git.sesse.net Git - ffmpeg/commitdiff
nsvdec: fix division by 0
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 20 Oct 2012 18:12:13 +0000 (20:12 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 20 Oct 2012 18:20:39 +0000 (20:20 +0200)
Fixes CID717749
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/nsvdec.c

index e64fffb218cffd44fe3717f9a3ee2c778471773b..3015d844919bacf3721c3b5853744f7aa758520a 100644 (file)
@@ -653,7 +653,10 @@ null_chunk_retry:
                 if (bps != 16) {
                     av_dlog(s, "NSV AUDIO bit/sample != 16 (%d)!!!\n", bps);
                 }
-                bps /= channels; // ???
+                if(channels)
+                    bps /= channels; // ???
+                else
+                    av_log(s, AV_LOG_WARNING, "Channels is 0\n");
                 if (bps == 8)
                     st[NSV_ST_AUDIO]->codec->codec_id = AV_CODEC_ID_PCM_U8;
                 samplerate /= 4;/* UGH ??? XXX */