Merge commit '8dc4b2c92e492aa172327d10c926d5ca3a04371c' into release/1.1
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 7 Sep 2013 11:13:12 +0000 (13:13 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 7 Sep 2013 11:13:12 +0000 (13:13 +0200)
* commit '8dc4b2c92e492aa172327d10c926d5ca3a04371c':
  pictordec: break out of both decoding loops when y drops below 0
  vcr1: add sanity checks

Conflicts:
libavcodec/pictordec.c
libavcodec/vcr1.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavcodec/pictordec.c
libavcodec/vcr1.c

@@@ -242,21 -233,11 +244,22 @@@ static int decode_frame(AVCodecContext 
                  }
              }
          }
 +
 +        if (x < avctx->width && y >= 0) {
 +            int run = (y + 1) * avctx->width - x;
 +            if (bits_per_plane == 8)
 +                picmemset_8bpp(s, val, run, &x, &y);
 +            else
 +                picmemset(s, val, run / (8 / bits_per_plane), &x, &y, &plane, bits_per_plane);
 +        }
      } else {
 -        av_log_ask_for_sample(s, "uncompressed image\n");
 -        return avpkt->size;
 +        while (y >= 0 && bytestream2_get_bytes_left(&s->g) > 0) {
 +            memcpy(s->frame.data[0] + y * s->frame.linesize[0], s->g.buffer, FFMIN(avctx->width, bytestream2_get_bytes_left(&s->g)));
 +            bytestream2_skip(&s->g, avctx->width);
 +            y--;
 +        }
      }
+ finish:
  
      *got_frame      = 1;
      *(AVFrame*)data = s->frame;
@@@ -51,10 -50,11 +51,11 @@@ static av_cold int vcr1_decode_init(AVC
  
      avctx->pix_fmt = AV_PIX_FMT_YUV410P;
  
 -    if (avctx->width & 7) {
 -        av_log(avctx, AV_LOG_ERROR, "Width %d is not divisble by 8.\n", avctx->width);
 +    if (avctx->width % 8 || avctx->height%4) {
-         av_log_ask_for_sample(avctx, "odd dimensions are not supported\n");
-         return AVERROR_PATCHWELCOME;
++        av_log_ask_for_sample(avctx, "odd dimensions (%d x %d) support", avctx->width, avctx->height);
+         return AVERROR_INVALIDDATA;
      }
      return 0;
  }