[FFmpeg-devel] [PATCH] aiffdec: fix division by zero

Andreas Cadhalpun andreas.cadhalpun at googlemail.com
Sun Oct 16 23:38:42 EEST 2016


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 cd916f9..de82787 100644
--- a/libavformat/aiffdec.c
+++ b/libavformat/aiffdec.c
@@ -380,7 +380,7 @@ static int aiff_read_packet(AVFormatContext *s,
         size = st->codecpar->block_align;
         break;
     default:
-        size = (MAX_SIZE / st->codecpar->block_align) * st->codecpar->block_align;
+        size = st->codecpar->block_align ? (MAX_SIZE / st->codecpar->block_align) * st->codecpar->block_align : MAX_SIZE;
     }
     size = FFMIN(max_size, size);
     res = av_get_packet(s->pb, pkt, size);
-- 
2.9.3


More information about the ffmpeg-devel mailing list