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>
Sat, 26 Nov 2016 23:27:56 +0000 (00:27 +0100)
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit c143a9c96ff907a8fe4598529664aec7cb156708)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
libavformat/aiffdec.c

index d191bc4..bad92a0 100644 (file)
@@ -376,7 +376,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);