[FFmpeg-cvslog] avcodec/utils: use a minimum 32pixel width in avcodec_align_dimensions2() for H.264
Michael Niedermayer
git at videolan.org
Tue Jul 28 03:21:44 CEST 2015
ffmpeg | branch: release/2.5 | Michael Niedermayer <michaelni at gmx.at> | Fri Jul 10 02:01:17 2015 +0200| [80e091853d1e6ea2bcbc1972b87ce662f9eefff5] | committer: Michael Niedermayer
avcodec/utils: use a minimum 32pixel width in avcodec_align_dimensions2() for H.264
Fixes Assertion failure
Found-by: Andreas Cadhalpun <andreas.cadhalpun at googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 7ef6656b1e5bfbc7499013d3b38b093b6b2f31ec)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=80e091853d1e6ea2bcbc1972b87ce662f9eefff5
---
libavcodec/utils.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index d30ad2e..0cc1f90 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;
More information about the ffmpeg-cvslog
mailing list