[FFmpeg-devel] fix for >2GB files in flvdec.c

Måns Rullgård mans
Mon Oct 20 19:52:22 CEST 2008


Pascal Massimino wrote:
>   Hey Baptiste,
>
> On Mon, Oct 20, 2008 at 10:08 AM, Baptiste Coudurier
> <baptiste.coudurier at smartjog.com> wrote:
>> Hi Pascal,
>>
>> Pascal Massimino wrote:
>>> Hi everybody,
>>>
>>> patch against r15655 attached...
>>>
>>  > [...]
>>>
>>  > @@ -317,7 +318,7 @@
>>>      if(size == 0)
>>>          continue;
>>>
>>> -    next= size + url_ftell(s->pb);
>>> +    next= url_ftell(s->pb) + size;
>>
>> Cosmetics ?
>
> well, actually i'm not sure: will 'size' be promoted int64 if it's
> first? or will the int64 in url_ftell() be demoted 'int' because of
> the 'size' in front (yikes!)?
> In doubt, i rely on left-to-right prevalence rule, but that's maybe
> just me...

There is no such rule.  In a simple expression like a + b, 'a' and 'b'
are converted to the wider of the two types and the converted values
added.  The order does not matter at all.  There are rules dealing
with mixed signed and unsigned types as well.  Refer to the C99 spec
for the all the gory details.

If you're writing C code, you really should know this.

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-devel mailing list