Merge commit 'b26742cc308552f242ee2bf93b07a3ff509f4edc'
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 12 Sep 2013 11:37:20 +0000 (13:37 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 12 Sep 2013 11:38:52 +0000 (13:38 +0200)
* commit 'b26742cc308552f242ee2bf93b07a3ff509f4edc':
  shorten: Break out of loop looking for fmt chunk if none is found

See: 5e9a56a0350c518cd4b38845aff49d41a9c952ae
Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavcodec/shorten.c

@@@ -227,9 -220,11 +227,11 @@@ static int decode_wave_header(AVCodecCo
  
      while (bytestream2_get_le32(&gb) != MKTAG('f', 'm', 't', ' ')) {
          len = bytestream2_get_le32(&gb);
-         if (len<0 || bytestream2_get_bytes_left(&gb) - 8 < len)
-             return AVERROR_INVALIDDATA;
          bytestream2_skip(&gb, len);
 -        if (bytestream2_get_bytes_left(&gb) < 16) {
++        if (len < 0 || bytestream2_get_bytes_left(&gb) < 16) {
+             av_log(avctx, AV_LOG_ERROR, "no fmt chunk found\n");
+             return AVERROR_INVALIDDATA;
+         }
      }
      len = bytestream2_get_le32(&gb);