[FFmpeg-devel] [PATCH] id3v2: always skip padding

Alexander Kojevnikov alexander
Tue Jul 27 16:48:42 CEST 2010


On 27 July 2010 23:23, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Tue, Jul 27, 2010 at 12:29:29PM +1000, Alexander Kojevnikov wrote:
>> Hi list,
>>
>> If padding at the end of an id3v2 tag is less than `taghdrlen` (10
>> bytes), it is not skipped. As a result, the buffer points at an
>> incorrect position which later results in "Header missing" errors.
>>
>> Attached patch fixes this issue.
>>
>> Cheers,
>> Alex
>
>> ?id3v2.c | ? ?5 ++++-
>> ?1 file changed, 4 insertions(+), 1 deletion(-)
>> 0fee5829ca199fc7ff83ad27e5ee8af839a365ab ?0001-id3v2-always-skip-padding.patch
>> From 19f82c52719b7cac498acdc1392c9c8c80eafb3f Mon Sep 17 00:00:00 2001
>> From: Alexander Kojevnikov <alexander at kojevnikov.com>
>> Date: Tue, 27 Jul 2010 12:20:37 +1000
>> Subject: [PATCH] id3v2: always skip padding
>>
>> ---
>> ?libavformat/id3v2.c | ? ?5 ++++-
>> ?1 files changed, 4 insertions(+), 1 deletions(-)
>>
>> diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c
>> index 38c272a..8d050af 100644
>> --- a/libavformat/id3v2.c
>> +++ b/libavformat/id3v2.c
>> @@ -266,13 +266,16 @@ void ff_id3v2_parse(AVFormatContext *s, int len, uint8_t version, uint8_t flags)
>> ? ? ? ? ?else if (!tag[0]) {
>> ? ? ? ? ? ? ?if (tag[1])
>> ? ? ? ? ? ? ? ? ?av_log(s, AV_LOG_WARNING, "invalid frame id, assuming padding");
>> - ? ? ? ? ? ?url_fskip(s->pb, len);
>
> this maybe should be tlen

It has to be `len` which initially contains the size of the entire tag
including the padding and is decremented after each tag frame is read.
`tlen` on the other hand contains the size of the current tag frame,
it tells us nothing about padding.



More information about the ffmpeg-devel mailing list