aiffdec: fix division by zero
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Sun, 16 Oct 2016 20:29:13 +0000 (22:29 +0200)
committerAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Mon, 17 Oct 2016 16:24:48 +0000 (18:24 +0200)
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
libavformat/aiffdec.c

index cd916f9..de82787 100644 (file)
@@ -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);