Merge commit 'e87f5e4e5f2e2e36b0b7826d708cda7049877af0'
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 26 Aug 2014 20:01:45 +0000 (22:01 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 26 Aug 2014 20:01:45 +0000 (22:01 +0200)
* commit 'e87f5e4e5f2e2e36b0b7826d708cda7049877af0':
  h264: fully check cropping amount from sps

Conflicts:
libavcodec/h264_slice.c

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

@@@ -1109,11 -1028,11 +1109,13 @@@ static int init_dimensions(H264Context 
  {
      int width  = h->width  - (h->sps.crop_right + h->sps.crop_left);
      int height = h->height - (h->sps.crop_top   + h->sps.crop_bottom);
+     int crop_present = h->sps.crop_left  || h->sps.crop_top ||
+                        h->sps.crop_right || h->sps.crop_bottom;
 +    av_assert0(h->sps.crop_right + h->sps.crop_left < (unsigned)h->width);
 +    av_assert0(h->sps.crop_top + h->sps.crop_bottom < (unsigned)h->height);
  
      /* handle container cropping */
-     if (!h->sps.crop &&
+     if (!crop_present &&
          FFALIGN(h->avctx->width,  16) == h->width &&
          FFALIGN(h->avctx->height, 16) == h->height) {
          width  = h->avctx->width;