summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>2010-01-04 22:58:19 +0000
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2010-01-04 22:58:19 +0000
commita510991cffb7230563d9b4f5b87c547462dae01e (patch)
treedac2e0c1111330245533a8d5c6d6a3a85ab49d1a
parentcb41b2b6e094adde9222ceff24f0dfa51521c76b (diff)
simplify error handling in mov_read_default
Originally committed as revision 21024 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavformat/mov.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 48242bb821..2b045bdcf5 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -181,11 +181,10 @@ static int mov_read_default(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
int64_t total_size = 0;
MOVAtom a;
int i;
- int err = 0;
if (atom.size < 0)
atom.size = INT64_MAX;
- while(((total_size + 8) < atom.size) && !url_feof(pb) && !err) {
+ while(((total_size + 8) < atom.size) && !url_feof(pb)) {
int (*parse)(MOVContext*, ByteIOContext*, MOVAtom) = NULL;
a.size = atom.size;
a.type=0;
@@ -226,7 +225,9 @@ static int mov_read_default(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
} else {
int64_t start_pos = url_ftell(pb);
int64_t left;
- err = parse(c, pb, a);
+ int err = parse(c, pb, a);
+ if (err < 0)
+ return err;
if (url_is_streamed(pb) && c->found_moov && c->found_mdat)
break;
left = a.size - url_ftell(pb) + start_pos;
@@ -237,10 +238,10 @@ static int mov_read_default(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
total_size += a.size;
}
- if (!err && total_size < atom.size && atom.size < 0x7ffff)
+ if (total_size < atom.size && atom.size < 0x7ffff)
url_fskip(pb, atom.size - total_size);
- return err;
+ return 0;
}
static int mov_read_dref(MOVContext *c, ByteIOContext *pb, MOVAtom atom)