Browse Source

h264: fully check cropping amount from sps

Even if sps.crop is true, the cropping amount may be zero.
Fixes a sample with a valid but broken container cropping.
tags/n2.4
Vittorio Giovara 11 years ago
parent
commit
e87f5e4e5f
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      libavcodec/h264_slice.c

+ 3
- 1
libavcodec/h264_slice.c View File

@@ -1028,9 +1028,11 @@ static int init_dimensions(H264Context *h)
{
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;

/* 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;


Loading…
Cancel
Save