aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/anm.c
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2013-03-09 22:28:02 +0100
committerDiego Biurrun <diego@biurrun.de>2013-03-12 11:05:28 +0100
commit8f10f1a6dc0d326a146e169860a2de7a8356fdab (patch)
tree99c6ad73674f482a232bcfc0ab2e5e620f5ebbed /libavformat/anm.c
parent202c2acc40a6de8758b44ab3f5c85ab250079734 (diff)
downloadffmpeg-8f10f1a6dc0d326a146e169860a2de7a8356fdab.tar.gz
anm: Get rid of some very silly goto statements
Diffstat (limited to 'libavformat/anm.c')
-rw-r--r--libavformat/anm.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/libavformat/anm.c b/libavformat/anm.c
index 7e52e8355b..dc24e78941 100644
--- a/libavformat/anm.c
+++ b/libavformat/anm.c
@@ -135,17 +135,16 @@ static int read_header(AVFormatContext *s)
st->codec->extradata_size = 16*8 + 4*256;
st->codec->extradata = av_mallocz(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
if (!st->codec->extradata) {
- ret = AVERROR(ENOMEM);
- goto fail;
+ return AVERROR(ENOMEM);
}
ret = avio_read(pb, st->codec->extradata, st->codec->extradata_size);
if (ret < 0)
- goto fail;
+ return ret;
/* read page table */
ret = avio_seek(pb, anm->page_table_offset, SEEK_SET);
if (ret < 0)
- goto fail;
+ return ret;
for (i = 0; i < MAX_PAGES; i++) {
Page *p = &anm->pt[i];
@@ -157,8 +156,7 @@ static int read_header(AVFormatContext *s)
/* find page of first frame */
anm->page = find_record(anm, 0);
if (anm->page < 0) {
- ret = anm->page;
- goto fail;
+ return anm->page;
}
anm->record = -1;
@@ -166,10 +164,7 @@ static int read_header(AVFormatContext *s)
invalid:
av_log_ask_for_sample(s, NULL);
- ret = AVERROR_PATCHWELCOME;
-
-fail:
- return ret;
+ return AVERROR_PATCHWELCOME;
}
static int read_packet(AVFormatContext *s,