1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-07-19 02:41:38 +02:00

Merge commit 'd466d82faaf6e0e57a3a4be5e38e3902ef251ac3'

* commit 'd466d82faaf6e0e57a3a4be5e38e3902ef251ac3':
  dvdsubdec: Do not leak on failure path

Conflicts:
	libavcodec/dvdsubdec.c

See: 7fa9f7ef1c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2014-11-21 22:33:23 +01:00
commit ac967ad872

View File

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