Browse Source

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>
tags/n2.5
Michael Niedermayer 11 years ago
parent
commit
8cd80b5fcb
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      libavformat/jacosubdec.c

+ 4
- 1
libavformat/jacosubdec.c View File

@@ -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)


Loading…
Cancel
Save