[FFmpeg-devel] [PATCH 2/2] lavf/id3v2: seek back to previous offset if header size is not matched

Michael Niedermayer michaelni at gmx.at
Sat Jan 19 14:41:00 CET 2013


On Sat, Jan 19, 2013 at 01:38:27PM +0100, Matthieu Bouron wrote:
> ---
>  libavformat/id3v2.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c
> index 98f8f9e..2cab5ac 100644
> --- a/libavformat/id3v2.c
> +++ b/libavformat/id3v2.c
> @@ -788,8 +788,10 @@ void ff_id3v2_read(AVFormatContext *s, const char *magic, ID3v2ExtraMeta **extra
>          /* save the current offset in case there's nothing to read/skip */
>          off = avio_tell(s->pb);
>          ret = avio_read(s->pb, buf, ID3v2_HEADER_SIZE);
> -        if (ret != ID3v2_HEADER_SIZE)
> +        if (ret != ID3v2_HEADER_SIZE) {
> +            avio_seek(s->pb, off, SEEK_SET);
>              break;
> +        }

the change looks fine but please explain (also in the commit message)
why this change is done

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The real ebay dictionary, page 1
"Used only once"    - "Some unspecified defect prevented a second use"
"In good condition" - "Can be repaird by experienced expert"
"As is" - "You wouldnt want it even if you were payed for it, if you knew ..."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130119/9375e079/attachment.asc>


More information about the ffmpeg-devel mailing list