[FFmpeg-cvslog] nsvdec: fix division by 0

Michael Niedermayer git at videolan.org
Sat Oct 20 20:27:56 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Oct 20 20:12:13 2012 +0200| [d633e15d7d939f532326e2bc92097b12eba4d5ae] | committer: Michael Niedermayer

nsvdec: fix division by 0

Fixes CID717749
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavformat/nsvdec.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavformat/nsvdec.c b/libavformat/nsvdec.c
index e64fffb..3015d84 100644
--- a/libavformat/nsvdec.c
+++ b/libavformat/nsvdec.c
@@ -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 */



More information about the ffmpeg-cvslog mailing list