[FFmpeg-devel] [PATCHv2] avcodec/apedec: fix bug introduced in commit d3e5fbb1406995e07fccbff3ca8c1e24f57a1f7b

Ronald S. Bultje rsbultje at gmail.com
Sat Oct 3 17:14:28 CEST 2015


Hi,

On Sat, Oct 3, 2015 at 10:22 AM, Ganesh Ajjanagadde <gajjanag at mit.edu>
wrote:

> On Sat, Oct 3, 2015 at 9:15 AM, Henrik Gramner <henrik at gramner.com> wrote:
> > On Sat, Oct 3, 2015 at 2:58 PM, Ronald S. Bultje <rsbultje at gmail.com>
> wrote:
> >> I wonder if some compilers will complain that this overflows (strictly
> >> speaking it does) and that it should be -0x80000000 instead?
> >
> > -0x80000000 isn't a valid 32-bit integer in C. For this reason
> > INT32_MIN is usually defined to something like (-0x7fffffff -1).
>
> Indeed, see e.g:
> "There are no negative integer literals. Expressions such as -1 apply
> the unary minus operator to the value represented by the literal,
> which may involve implicit type conversions." (from
> http://en.cppreference.com/w/cpp/language/integer_literal).
>
> Should we go ahead with the INT32_MIN then?


I would say yes.

Ronald


More information about the ffmpeg-devel mailing list