[FFmpeg-devel] [PATCH] avcodec/utils: use a minimum 32pixel width in avcodec_align_dimensions2() for H.264
Michael Niedermayer
michael at niedermayer.cc
Fri Jul 10 18:35:22 CEST 2015
On Fri, Jul 10, 2015 at 10:51:45AM -0400, Ronald S. Bultje wrote:
> Hi,
>
> On Thu, Jul 9, 2015 at 8:11 PM, Michael Niedermayer <michaelni at gmx.at>
> wrote:
>
> > Fixes Assertion failure
> > Found-by: Andreas Cadhalpun <andreas.cadhalpun at googlemail.com>
> > Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> > ---
> > libavcodec/utils.c | 4 +++-
> > 1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/libavcodec/utils.c b/libavcodec/utils.c
> > index 96f177d..925b3ed 100644
> > --- a/libavcodec/utils.c
> > +++ b/libavcodec/utils.c
> > @@ -428,10 +428,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);
> > + }
>
>
> Would you mind adding a comment why? This codec-specific hackery tends to
> raise lots of eyebrows a few years after, so knowing what exactly it fixes
> is very useful.
>
> (E.g. what assertion, caused by what file with what special feature that
> technically cause the assert, etc.)
comment added in a moment
thanks
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
No snowflake in an avalanche ever feels responsible. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150710/355a7dfa/attachment.sig>
More information about the ffmpeg-devel
mailing list