You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
anm: Get rid of some very silly goto statements
This commit is contained in:
@@ -135,17 +135,16 @@ static int read_header(AVFormatContext *s)
|
|||||||
st->codec->extradata_size = 16*8 + 4*256;
|
st->codec->extradata_size = 16*8 + 4*256;
|
||||||
st->codec->extradata = av_mallocz(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
|
st->codec->extradata = av_mallocz(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
|
||||||
if (!st->codec->extradata) {
|
if (!st->codec->extradata) {
|
||||||
ret = AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
goto fail;
|
|
||||||
}
|
}
|
||||||
ret = avio_read(pb, st->codec->extradata, st->codec->extradata_size);
|
ret = avio_read(pb, st->codec->extradata, st->codec->extradata_size);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto fail;
|
return ret;
|
||||||
|
|
||||||
/* read page table */
|
/* read page table */
|
||||||
ret = avio_seek(pb, anm->page_table_offset, SEEK_SET);
|
ret = avio_seek(pb, anm->page_table_offset, SEEK_SET);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto fail;
|
return ret;
|
||||||
|
|
||||||
for (i = 0; i < MAX_PAGES; i++) {
|
for (i = 0; i < MAX_PAGES; i++) {
|
||||||
Page *p = &anm->pt[i];
|
Page *p = &anm->pt[i];
|
||||||
@@ -157,8 +156,7 @@ static int read_header(AVFormatContext *s)
|
|||||||
/* find page of first frame */
|
/* find page of first frame */
|
||||||
anm->page = find_record(anm, 0);
|
anm->page = find_record(anm, 0);
|
||||||
if (anm->page < 0) {
|
if (anm->page < 0) {
|
||||||
ret = anm->page;
|
return anm->page;
|
||||||
goto fail;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
anm->record = -1;
|
anm->record = -1;
|
||||||
@@ -166,10 +164,7 @@ static int read_header(AVFormatContext *s)
|
|||||||
|
|
||||||
invalid:
|
invalid:
|
||||||
av_log_ask_for_sample(s, NULL);
|
av_log_ask_for_sample(s, NULL);
|
||||||
ret = AVERROR_PATCHWELCOME;
|
return AVERROR_PATCHWELCOME;
|
||||||
|
|
||||||
fail:
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int read_packet(AVFormatContext *s,
|
static int read_packet(AVFormatContext *s,
|
||||||
|
Reference in New Issue
Block a user