@@ -114,7 +114,6 @@ static int read_header(AVFormatContext *s)
jv->frames = av_malloc(ast->nb_index_entries * sizeof(JVFrame));
if (!jv->frames) {
- av_freep(&ast->index_entries);
return AVERROR(ENOMEM);
}
offset = 0x68 + ast->nb_index_entries * 16;
@@ -137,9 +136,6 @@ static int read_header(AVFormatContext *s)
- jvf->video_size
- jvf->palette_size < 0) {
if (s->error_recognition & AV_EF_EXPLODE) {
- read_close(s);
- av_freep(&jv->frames);
- av_freep(&ast->index_entries);
return AVERROR_INVALIDDATA;
}
jvf->audio_size =
@@ -263,4 +259,5 @@ AVInputFormat ff_jv_demuxer = {
.read_packet = read_packet,
.read_seek = read_seek,
.read_close = read_close,
+ .flags_internal = FF_INPUTFORMAT_HEADER_CLEANUP,
};
by setting the FF_INPUTFORMAT_HEADER_CLEANUP flag. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> --- libavformat/jvdec.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)