mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
dvdsubdec: fix bad free in dvdsub_init
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
15240feb99
commit
872655fee9
@ -516,12 +516,12 @@ static int dvdsub_decode(AVCodecContext *avctx,
|
|||||||
static int dvdsub_init(AVCodecContext *avctx)
|
static int dvdsub_init(AVCodecContext *avctx)
|
||||||
{
|
{
|
||||||
DVDSubContext *ctx = (DVDSubContext*) avctx->priv_data;
|
DVDSubContext *ctx = (DVDSubContext*) avctx->priv_data;
|
||||||
char *data;
|
char *dataorig, *data;
|
||||||
|
|
||||||
if (!avctx->extradata || !avctx->extradata_size)
|
if (!avctx->extradata || !avctx->extradata_size)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
data = av_malloc(avctx->extradata_size+1);
|
dataorig = data = av_malloc(avctx->extradata_size+1);
|
||||||
if (!data)
|
if (!data)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
memcpy(data, avctx->extradata, avctx->extradata_size);
|
memcpy(data, avctx->extradata, avctx->extradata_size);
|
||||||
@ -555,7 +555,7 @@ static int dvdsub_init(AVCodecContext *avctx)
|
|||||||
av_log(avctx, AV_LOG_DEBUG, "\n");
|
av_log(avctx, AV_LOG_DEBUG, "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
av_free(data);
|
av_free(dataorig);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user