summaryrefslogtreecommitdiff
path: root/libavformat/id3v2.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2011-03-15 07:54:22 +0100
committerRonald S. Bultje <rsbultje@gmail.com>2011-03-21 15:08:01 -0400
commiteb1e7f78ea9f8db391961d8fe30b3fae3ea20d5c (patch)
tree1aa7ba1c4cdbc7d1263455f7ec2573e8e183442f /libavformat/id3v2.c
parentbca6dee386307e4f3646632d98a9db87ce9de249 (diff)
id3v2: simplify error handling.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Diffstat (limited to 'libavformat/id3v2.c')
-rw-r--r--libavformat/id3v2.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c
index fb4c761a27..13272a493f 100644
--- a/libavformat/id3v2.c
+++ b/libavformat/id3v2.c
@@ -188,7 +188,7 @@ static void ff_id3v2_parse(AVFormatContext *s, int len, uint8_t version, uint8_t
char tag[5];
int64_t next, end = avio_tell(s->pb) + len;
int taghdrlen;
- const char *reason;
+ const char *reason = NULL;
AVIOContext pb;
unsigned char *buffer = NULL;
int buffer_size = 0;
@@ -286,14 +286,12 @@ static void ff_id3v2_parse(AVFormatContext *s, int len, uint8_t version, uint8_t
if (version == 4 && flags & 0x10) /* Footer preset, always 10 bytes, skip over it */
end += 10;
+ error:
+ if (reason)
+ av_log(s, AV_LOG_INFO, "ID3v2.%d tag skipped, cannot handle %s\n", version, reason);
avio_seek(s->pb, end, SEEK_SET);
av_free(buffer);
return;
-
- error:
- av_log(s, AV_LOG_INFO, "ID3v2.%d tag skipped, cannot handle %s\n", version, reason);
- avio_seek(s->pb, len, SEEK_CUR);
- av_free(buffer);
}
void ff_id3v2_read(AVFormatContext *s, const char *magic)