[FFmpeg-devel] [PATCH] avcodec/yuv4enc: do not read past end of input in case of odd height

Anton Khirnov anton at khirnov.net
Wed Sep 6 14:18:00 EEST 2023


Quoting Tomas Härdin (2023-09-06 08:16:12)
> ons 2023-09-06 klockan 02:35 +0200 skrev Paul B Mahol:
> > +    if (avctx->height & 1) {
> > +        for (j = 0; j < avctx->width + 1 >> 1; j++) {
> 
> Don't we usually wrap shifted expressions in parentheses? I know >> is
> lower presedence than + (a wtf in itself tbh) but I seem to recall
> parens being the norm in much of the codebase.

Using ">> 1" to mean "/ 2" is a relic from the days of non-optimizing
compilers anyway.

-- 
Anton Khirnov


More information about the ffmpeg-devel mailing list