summaryrefslogtreecommitdiffstats
path: root/libavformat/asfdec_f.c
diff options
context:
space:
mode:
authorJohn Adlum <john.adlum@nospam>2015-07-01 23:21:53 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-07-02 04:58:18 +0200
commitc8eca438a953b4a8ee3b863abac38491357b46a1 (patch)
tree9b8f32727673fe3e95a79548c9a3218d8a719984 /libavformat/asfdec_f.c
parenta1c03b9d58824d984a93f79a8939749b0699bfee (diff)
downloadffmpeg-streaming-c8eca438a953b4a8ee3b863abac38491357b46a1.zip
ffmpeg-streaming-c8eca438a953b4a8ee3b863abac38491357b46a1.tar.gz
avformat/asfdec_f: factor error checking out of main header parsing loop
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/asfdec_f.c')
-rw-r--r--libavformat/asfdec_f.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/libavformat/asfdec_f.c b/libavformat/asfdec_f.c
index 6dbd2b9..807df4e 100644
--- a/libavformat/asfdec_f.c
+++ b/libavformat/asfdec_f.c
@@ -779,6 +779,7 @@ static int asf_read_header(AVFormatContext *s)
for (;;) {
uint64_t gpos = avio_tell(pb);
+ int ret = 0;
ff_get_guid(pb, &g);
gsize = avio_rl64(pb);
print_guid(&g);
@@ -795,13 +796,9 @@ static int asf_read_header(AVFormatContext *s)
if (gsize < 24)
return AVERROR_INVALIDDATA;
if (!ff_guidcmp(&g, &ff_asf_file_header)) {
- int ret = asf_read_file_properties(s, gsize);
- if (ret < 0)
- return ret;
+ ret = asf_read_file_properties(s, gsize);
} else if (!ff_guidcmp(&g, &ff_asf_stream_header)) {
- int ret = asf_read_stream_properties(s, gsize);
- if (ret < 0)
- return ret;
+ ret = asf_read_stream_properties(s, gsize);
} else if (!ff_guidcmp(&g, &ff_asf_comment_header)) {
asf_read_content_desc(s, gsize);
} else if (!ff_guidcmp(&g, &ff_asf_language_guid)) {
@@ -830,7 +827,6 @@ static int asf_read_header(AVFormatContext *s)
if (!s->keylen) {
if (!ff_guidcmp(&g, &ff_asf_content_encryption)) {
unsigned int len;
- int ret;
AVPacket pkt;
av_log(s, AV_LOG_WARNING,
"DRM protected stream detected, decoding will likely fail!\n");
@@ -856,6 +852,9 @@ static int asf_read_header(AVFormatContext *s)
}
}
}
+ if (ret < 0)
+ return ret;
+
if (avio_tell(pb) != gpos + gsize)
av_log(s, AV_LOG_DEBUG,
"gpos mismatch our pos=%"PRIu64", end=%"PRId64"\n",
OpenPOWER on IntegriCloud