diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-11-21 22:33:23 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-11-21 22:36:01 +0100 |
commit | ac967ad8724ee860085cd108f822b3f830b89767 (patch) | |
tree | 84d2e541182e1a942fafdb0830d25fe4dc55b2ac | |
parent | ad2424e6b2984b253769040a2f2d7fb1344098b8 (diff) | |
parent | d466d82faaf6e0e57a3a4be5e38e3902ef251ac3 (diff) | |
download | ffmpeg-ac967ad8724ee860085cd108f822b3f830b89767.tar.gz |
Merge commit 'd466d82faaf6e0e57a3a4be5e38e3902ef251ac3'
* commit 'd466d82faaf6e0e57a3a4be5e38e3902ef251ac3':
dvdsubdec: Do not leak on failure path
Conflicts:
libavcodec/dvdsubdec.c
See: 7fa9f7ef1c2f0cee81ec6ea6a4ff10af4c4fc62c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/dvdsubdec.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c index 1fb0a3878e..39604f3ada 100644 --- a/libavcodec/dvdsubdec.c +++ b/libavcodec/dvdsubdec.c @@ -649,6 +649,7 @@ static int dvdsub_parse_extradata(AVCodecContext *avctx) { DVDSubContext *ctx = (DVDSubContext*) avctx->priv_data; char *dataorig, *data; + int ret = 1; if (!avctx->extradata || !avctx->extradata_size) return 1; @@ -669,11 +670,9 @@ static int dvdsub_parse_extradata(AVCodecContext *avctx) } else if (strncmp("size:", data, 5) == 0) { int w, h; if (sscanf(data + 5, "%dx%d", &w, &h) == 2) { - int ret = ff_set_dimensions(avctx, w, h); - if (ret < 0) { - av_free(dataorig); - return ret; - } + ret = ff_set_dimensions(avctx, w, h); + if (ret < 0) + goto fail; } } @@ -681,8 +680,9 @@ static int dvdsub_parse_extradata(AVCodecContext *avctx) data += strspn(data, "\n\r"); } +fail: av_free(dataorig); - return 1; + return ret; } static av_cold int dvdsub_init(AVCodecContext *avctx) |