[FFmpeg-devel] [PATCH 3/3] avcodec/x86/lossless_videoencdsp: Fix warning: signed dword value exceeds bounds

Michael Niedermayer michael at niedermayer.cc
Thu Oct 5 01:50:30 EEST 2017


On Sun, Oct 01, 2017 at 02:10:41AM +0200, Henrik Gramner wrote:
> On Sat, Sep 30, 2017 at 12:58 AM, Michael Niedermayer
> <michael at niedermayer.cc> wrote:
> > -    and                i, -2 * regsize
> > +    and                i, -(2 * regsize)
> 
> regsize is defined to mmsize / 2 in the relevant case so the
> expression resolves to -2 * 16 / 2
> 
> In nasm integers are 64-bit and / is unsigned division (// is signed
> division). When you perform unsigned division on a negative number you
> get a large number that doesn't fit inside a 32-bit immediate. E.g.
> the warning is working as intended.
> 

> A better fix is to either use parentheses in the regsize definition
> (e.g. what you'd normally do in an equivalent C define), or use

yes, thats better, ill push a fix with that

thanks


> %assign instead of %define. Using // is kind of ugly so I rather avoid
> that.
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Complexity theory is the science of finding the exact solution to an
approximation. Benchmarking OTOH is finding an approximation of the exact
-------------- 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/20171005/f587b05c/attachment.sig>


More information about the ffmpeg-devel mailing list