[FFmpeg-cvslog] r11681 - trunk/libavformat/asf.c

Måns Rullgård mans
Thu Jan 31 10:29:58 CET 2008


Diego Biurrun <diego at biurrun.de> writes:

> On Thu, Jan 31, 2008 at 01:22:25AM +0100, bcoudurier wrote:
>> 
>> Log:
>> typo, also fix warning: asf.c:90: warning: passing argument 2 of 'get_buffer' from incompatible pointer type
>> 
>> --- trunk/libavformat/asf.c	(original)
>> +++ trunk/libavformat/asf.c	Thu Jan 31 01:22:25 2008
>> @@ -87,7 +87,7 @@ static void print_guid(const GUID *g)
>>  static void get_guid(ByteIOContext *s, GUID *g)
>>  {
>>      assert(sizeof(*g) == 16);
>> -    get_buffer(s, g, sizeof(*g));
>> +    get_buffer(s, *g, sizeof(*g));
>>  }
>
> Seems like we caught a real bug here...

Not really.  GUID is a typedef like this:

  typedef uint8_t GUID[16];

and the 'g' parameter is effectively uint8_t (*g)[16].  Thus g and *g
actually have the same value, only different types.

Moral of the story: do not typedef arrays.  It is confusing.

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




More information about the ffmpeg-cvslog mailing list