aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/h264_slice.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-08-26 22:01:45 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-08-26 22:01:45 +0200
commit570397c7311554f47d36574107e3d27cd53ec406 (patch)
treedcfe42903c3fd2b0b5a9b4c18bc1bed311dc5e13 /libavcodec/h264_slice.c
parent9c41b59423bbb86685c05bcf3ef9d4a7efb54f34 (diff)
parente87f5e4e5f2e2e36b0b7826d708cda7049877af0 (diff)
downloadffmpeg-570397c7311554f47d36574107e3d27cd53ec406.tar.gz
Merge commit 'e87f5e4e5f2e2e36b0b7826d708cda7049877af0'
* commit 'e87f5e4e5f2e2e36b0b7826d708cda7049877af0': h264: fully check cropping amount from sps Conflicts: libavcodec/h264_slice.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/h264_slice.c')
-rw-r--r--libavcodec/h264_slice.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index 20231aa5de..453094a7d4 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -1109,11 +1109,13 @@ 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;
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;