summaryrefslogtreecommitdiff
path: root/libavformat/jacosubdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-11-25 15:20:02 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-11-25 15:20:54 +0100
commit8cd80b5fcbfaefdb92faa8f3ed0b7f5651f38481 (patch)
tree8febc3639aae28499d2e74db01c22a9a0dd66320 /libavformat/jacosubdec.c
parent3d5d95db3f5d8e2093e9e19d0c46e86f54ed2a5d (diff)
downloadffmpeg-8cd80b5fcbfaefdb92faa8f3ed0b7f5651f38481.tar.gz
avformat/jacosubdec: Cleanup when avpriv_bprint_to_extradata() fails
Fixes memleaks Fixes: asan_heap-oob_4d2250_814_cov_2745172097_JACOsub_capability_tester.jss Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/jacosubdec.c')
-rw-r--r--libavformat/jacosubdec.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/jacosubdec.c b/libavformat/jacosubdec.c
index 9a288701a6..1ca0055877 100644
--- a/libavformat/jacosubdec.c
+++ b/libavformat/jacosubdec.c
@@ -232,7 +232,7 @@ static int jacosub_read_header(AVFormatContext *s)
/* general/essential directives in the extradata */
ret = avpriv_bprint_to_extradata(st->codec, &header);
if (ret < 0)
- return ret;
+ goto fail;
/* SHIFT and TIMERES affect the whole script so packet timing can only be
* done in a second pass */
@@ -243,6 +243,9 @@ static int jacosub_read_header(AVFormatContext *s)
ff_subtitles_queue_finalize(&jacosub->q);
return 0;
+fail:
+ jacosub_read_close(s);
+ return ret;
}
static int jacosub_read_packet(AVFormatContext *s, AVPacket *pkt)