aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/au.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2012-12-23 13:33:33 -0500
committerJustin Ruggles <justin.ruggles@gmail.com>2013-01-09 11:52:57 -0500
commitc837b38dd33a11c3810e988a60193a858eb4f58c (patch)
tree315209a63790b8e0c7fba8a4627286bbebcb4684 /libavformat/au.c
parentfb48f825e33c15146b8ce4e5258332ebc4a9b5ea (diff)
downloadffmpeg-c837b38dd33a11c3810e988a60193a858eb4f58c.tar.gz
au: move skipping of unused data to before parameter validation
Also do not unnecessarily skip 0 bytes.
Diffstat (limited to 'libavformat/au.c')
-rw-r--r--libavformat/au.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libavformat/au.c b/libavformat/au.c
index c429ce100d..f055a6fdf2 100644
--- a/libavformat/au.c
+++ b/libavformat/au.c
@@ -81,6 +81,11 @@ static int au_read_header(AVFormatContext *s)
rate = avio_rb32(pb);
channels = avio_rb32(pb);
+ if (size > 24) {
+ /* skip unused data */
+ avio_skip(pb, size - 24);
+ }
+
codec = ff_codec_get_id(codec_au_tags, id);
if (codec == AV_CODEC_ID_NONE) {
@@ -99,11 +104,6 @@ static int au_read_header(AVFormatContext *s)
return AVERROR_INVALIDDATA;
}
- if (size >= 24) {
- /* skip unused data */
- avio_skip(pb, size - 24);
- }
-
/* now we are ready: build format streams */
st = avformat_new_stream(s, NULL);
if (!st)