Hi, On Thu, Dec 15, 2011 at 8:39 PM, Uoti Urpala <[email protected]>wrote:
> On Thu, 2011-12-15 at 20:29 -0800, Ronald S. Bultje wrote: > > On Thu, Dec 15, 2011 at 8:26 PM, Uoti Urpala <[email protected]> > > wrote: > > > If the caller doesn't validate it and it can be INT_MAX then > > it can > > likely also be negative. So if you want to handle that case > > then the test should probably cast the value to an unsigned > > type. > > > > The pointers are unsigned, doesn't C dictate that a comparison between > > signed and unsigned will be unsigned? > > The data type the pointers *point to* may be unsigned, but that's > irrelevant here. The value actually being compared with is the result of > subtracting two pointers, which has type ptrdiff_t (a signed integer > type). > Hm, right. I must admit I'm not terribly happy about the state of skip_bits_long in the A32 case if I were to have to check n for overflow before adding it to bits_count, it'd get very messy. But maybe we don't care, since it's skip_bits_long()... Ronald
_______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
