Merge commit '0348e74c01a099a3787ae21df1c2a742fc846163'
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 13 May 2015 18:47:20 +0000 (20:47 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 13 May 2015 19:13:52 +0000 (21:13 +0200)
* commit '0348e74c01a099a3787ae21df1c2a742fc846163':
  quickdraw: Skip the empty 512 byte header for images

See: b453e768427969b170820e8e8fe51c84856563b2
Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavcodec/qdrw.c

@@@ -124,11 -124,11 +124,15 @@@ static int decode_frame(AVCodecContext 
      int w, h, ret;
  
      bytestream2_init(&gbc, avpkt->data, avpkt->size);
 +    if (   avpkt->size >= 552
 +        && AV_RB32(&avpkt->data[ 10]) != 0x001102FF
 +        && AV_RB32(&avpkt->data[522]) == 0x001102FF)
 +        bytestream2_skip(&gbc, 512);
  
+     /* PICT images start with a 512 bytes empty header */
+     if (bytestream2_peek_be32(&gbc) == 0)
+         bytestream2_skip(&gbc, 512);
      /* smallest PICT header */
      if (bytestream2_get_bytes_left(&gbc) < 40) {
          av_log(avctx, AV_LOG_ERROR, "Frame is too small %d\n",