summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorMans Rullgard <mans@mansr.com>2011-07-03 02:54:58 +0100
committerMans Rullgard <mans@mansr.com>2011-07-03 03:16:00 +0100
commitc9403419b25e36328cd25dc0855fd946c261a233 (patch)
tree9c8f7897ad274c2327fedaa76f7d0515df5d5a09 /libavformat
parent6728aaf6d8046ec0a82b6955b8bf27bf87358046 (diff)
avidec: simplify convoluted flow in avi_load_index()
Signed-off-by: Mans Rullgard <mans@mansr.com>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/avidec.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 871da0bb40..a00b9ced2d 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -1241,20 +1241,16 @@ static int avi_load_index(AVFormatContext *s)
(tag >> 16) & 0xff,
(tag >> 24) & 0xff,
size);
- switch(tag) {
- case MKTAG('i', 'd', 'x', '1'):
- if (avi_read_idx1(s, size) < 0)
- goto skip;
+
+ if (tag == MKTAG('i', 'd', 'x', '1') &&
+ avi_read_idx1(s, size) >= 0) {
ret = 0;
- goto the_end;
- break;
- default:
- skip:
- size += (size & 1);
- if (avio_skip(pb, size) < 0)
- goto the_end; // something is wrong here
break;
}
+
+ size += (size & 1);
+ if (avio_skip(pb, size) < 0)
+ break; // something is wrong here
}
the_end:
avio_seek(pb, pos, SEEK_SET);