[FFmpeg-devel] [PATCH] aiffdec: fix division by zero
Andreas Cadhalpun
andreas.cadhalpun at googlemail.com
Wed Oct 19 22:18:51 EEST 2016
This is similar to commit c143a9c.
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
---
libavformat/aiffdec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavformat/aiffdec.c b/libavformat/aiffdec.c
index de82787..d96fc1d 100644
--- a/libavformat/aiffdec.c
+++ b/libavformat/aiffdec.c
@@ -391,7 +391,7 @@ static int aiff_read_packet(AVFormatContext *s,
pkt->flags &= ~AV_PKT_FLAG_CORRUPT;
/* Only one stream in an AIFF file */
pkt->stream_index = 0;
- pkt->duration = (res / st->codecpar->block_align) * aiff->block_duration;
+ pkt->duration = (res / (st->codecpar->block_align ? st->codecpar->block_align : 1)) * aiff->block_duration ;
return 0;
}
--
2.9.3
More information about the ffmpeg-devel
mailing list