aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-10-20 20:12:13 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-10-20 20:20:39 +0200
commitd633e15d7d939f532326e2bc92097b12eba4d5ae (patch)
tree3e2a823f7151d568dc048badc94bd127bf21afdc
parentee23dcf534801931c13f9f534586b56e231d3085 (diff)
downloadffmpeg-d633e15d7d939f532326e2bc92097b12eba4d5ae.tar.gz
nsvdec: fix division by 0
Fixes CID717749 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/nsvdec.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/nsvdec.c b/libavformat/nsvdec.c
index e64fffb218..3015d84491 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 */