Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-07-10 03:01:17 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2015-07-20 05:43:41 +0300
commit6c98d5e7c83f18f8e9b65c0214d5593c0436a473 (patch)
treebba260afdde61babb6a9ed6e397d855ee4d32056
parent27a88f9d45d6fbd08796d8edc274a6758b3d170f (diff)
avcodec/utils: use a minimum 32pixel width in avcodec_align_dimensions2() for H.264
Fixes Assertion failure Found-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 7ef6656b1e5bfbc7499013d3b38b093b6b2f31ec) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/utils.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 5b284968b3..3c75df753a 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -424,10 +424,12 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
*width = FFALIGN(*width, w_align);
*height = FFALIGN(*height, h_align);
- if (s->codec_id == AV_CODEC_ID_H264 || s->lowres)
+ if (s->codec_id == AV_CODEC_ID_H264 || s->lowres) {
// some of the optimized chroma MC reads one line too much
// which is also done in mpeg decoders with lowres > 0
*height += 2;
+ *width = FFMAX(*width, 32);
+ }
for (i = 0; i < 4; i++)
linesize_align[i] = STRIDE_ALIGN;