mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-03-02 02:30:58 +00:00
Merge commit '5891fd017aa7bed4c423b8511090cf8641a0afa4' into release/2.4
* commit '5891fd017aa7bed4c423b8511090cf8641a0afa4':
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:
commit
c2b658c0e7
@ -586,6 +586,7 @@ static int dvdsub_parse_extradata(AVCodecContext *avctx)
|
|||||||
{
|
{
|
||||||
DVDSubContext *ctx = (DVDSubContext*) avctx->priv_data;
|
DVDSubContext *ctx = (DVDSubContext*) avctx->priv_data;
|
||||||
char *dataorig, *data;
|
char *dataorig, *data;
|
||||||
|
int ret = 1;
|
||||||
|
|
||||||
if (!avctx->extradata || !avctx->extradata_size)
|
if (!avctx->extradata || !avctx->extradata_size)
|
||||||
return 1;
|
return 1;
|
||||||
@ -606,11 +607,9 @@ static int dvdsub_parse_extradata(AVCodecContext *avctx)
|
|||||||
} else if (strncmp("size:", data, 5) == 0) {
|
} else if (strncmp("size:", data, 5) == 0) {
|
||||||
int w, h;
|
int w, h;
|
||||||
if (sscanf(data + 5, "%dx%d", &w, &h) == 2) {
|
if (sscanf(data + 5, "%dx%d", &w, &h) == 2) {
|
||||||
int ret = ff_set_dimensions(avctx, w, h);
|
ret = ff_set_dimensions(avctx, w, h);
|
||||||
if (ret < 0) {
|
if (ret < 0)
|
||||||
av_free(dataorig);
|
goto fail;
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -618,8 +617,9 @@ static int dvdsub_parse_extradata(AVCodecContext *avctx)
|
|||||||
data += strspn(data, "\n\r");
|
data += strspn(data, "\n\r");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fail:
|
||||||
av_free(dataorig);
|
av_free(dataorig);
|
||||||
return 1;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static av_cold int dvdsub_init(AVCodecContext *avctx)
|
static av_cold int dvdsub_init(AVCodecContext *avctx)
|
||||||
|
Loading…
Reference in New Issue
Block a user