[FFmpeg-devel] [PATCH] oggparseskeleton: Fix fisbone header parsing

James Almer jamrial at gmail.com
Sat Jul 6 18:38:32 CEST 2013


On 06/07/13 8:37 AM, Michael Niedermayer wrote:
>> diff --git a/libavformat/oggparseskeleton.c b/libavformat/oggparseskeleton.c
>> index 307387d..56f5713 100644
>> --- a/libavformat/oggparseskeleton.c
>> +++ b/libavformat/oggparseskeleton.c
> 
>> @@ -37,9 +37,6 @@ static int skeleton_header(AVFormatContext *s, int idx)
>>      strcpy(st->codec->codec_name, "skeleton");
>>      st->codec->codec_type = AVMEDIA_TYPE_DATA;
>>  
>> -    if (os->psize < 8)
>> -        return -1;
>> -
>>      if (!strncmp(buf, "fishead", 8)) {
>>          if (os->psize < 64)
>>              return -1;
> 
> why?
> this is supposed to check if buf contains 8 bytes for the strncmp
> 
> rest of the patch split & applied
> 
> thanks

That line generates an error about the Skeleton header parsing failing.
This is because the EOS page has a single packet of size 0, so skeleton_header()
returns -1.

I tested it here and strncmp() didn't have any problem checking for "fishead" and
"fisbone" in that 0 length packet (failing, obviously), but in any case an alternative
is to make

if (!(os->flags & OGG_FLAG_EOS) && os->psize < 8)
    return -1;

So that check is done in every page except the EOS.

Regards.


More information about the ffmpeg-devel mailing list