Do not limit blocksize when reading PCM from aiff.
authorCarl Eugen Hoyos <cehoyos@ag.or.at>
Mon, 2 Jun 2014 22:54:46 +0000 (00:54 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 3 Jun 2014 01:07:55 +0000 (03:07 +0200)
Fixes ticket #3695.

libavformat/aiffdec.c

index 81bcc64..7accec4 100644 (file)
@@ -344,10 +344,16 @@ static int aiff_read_packet(AVFormatContext *s,
         return AVERROR_EOF;
 
     /* Now for that packet */
-    if (st->codec->block_align >= 17) // GSM, QCLP, IMA4
+    switch (st->codec->codec_id) {
+    case AV_CODEC_ID_ADPCM_IMA_QT:
+    case AV_CODEC_ID_GSM:
+    case AV_CODEC_ID_QDM2:
+    case AV_CODEC_ID_QCELP:
         size = st->codec->block_align;
-    else
+        break;
+    default:
         size = (MAX_SIZE / st->codec->block_align) * st->codec->block_align;
+    }
     size = FFMIN(max_size, size);
     res = av_get_packet(s->pb, pkt, size);
     if (res < 0)