diff options
author | Kelly Anderson <kelly@silka.with-linux.com> | 2011-09-14 07:14:37 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-09-14 07:14:37 +0200 |
commit | 872655fee9168550cb9e12d37d7a38e56c7da0eb (patch) | |
tree | 74672f033500536157b62a25030de9b896f46c9c /libavcodec/dvdsubdec.c | |
parent | 15240feb992b6b41ca4afba928b9cb6edb0dc9fb (diff) | |
download | ffmpeg-872655fee9168550cb9e12d37d7a38e56c7da0eb.tar.gz |
dvdsubdec: fix bad free in dvdsub_init
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/dvdsubdec.c')
-rw-r--r-- | libavcodec/dvdsubdec.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c index 9eb5665c9d..021d30dfe7 100644 --- a/libavcodec/dvdsubdec.c +++ b/libavcodec/dvdsubdec.c @@ -516,12 +516,12 @@ static int dvdsub_decode(AVCodecContext *avctx, static int dvdsub_init(AVCodecContext *avctx) { DVDSubContext *ctx = (DVDSubContext*) avctx->priv_data; - char *data; + char *dataorig, *data; if (!avctx->extradata || !avctx->extradata_size) return 1; - data = av_malloc(avctx->extradata_size+1); + dataorig = data = av_malloc(avctx->extradata_size+1); if (!data) return AVERROR(ENOMEM); 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_free(data); + av_free(dataorig); return 1; } |