@@ -90,7 +90,6 @@ static int read_header(AVFormatContext *s)
PAFDemuxContext *p = s->priv_data;
AVIOContext *pb = s->pb;
AVStream *ast, *vst;
- int ret = 0;
avio_skip(pb, 132);
@@ -165,8 +164,7 @@ static int read_header(AVFormatContext *s)
!p->video_frame ||
!p->audio_frame ||
!p->temp_audio_frame) {
- ret = AVERROR(ENOMEM);
- goto fail;
+ return AVERROR(ENOMEM);
}
avio_seek(pb, p->buffer_size, SEEK_SET);
@@ -182,11 +180,6 @@ static int read_header(AVFormatContext *s)
avio_seek(pb, p->start_offset, SEEK_SET);
return 0;
-
-fail:
- read_close(s);
-
- return ret;
}
static int read_packet(AVFormatContext *s, AVPacket *pkt)
@@ -260,6 +253,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
AVInputFormat ff_paf_demuxer = {
.name = "paf",
.long_name = NULL_IF_CONFIG_SMALL("Amazing Studio Packed Animation File"),
+ .flags = AVFMT_HEADER_CLEANUP,
.priv_data_size = sizeof(PAFDemuxContext),
.read_probe = read_probe,
.read_header = read_header,
by setting the AVFMT_HEADER_CLEANUP flag. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> --- libavformat/paf.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)