diff options
author | Piotr Bandurski <ami_stuff@o2.pl> | 2013-09-14 04:38:15 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-09-14 17:35:48 +0200 |
commit | bb5e7d3b5ad21cefee5a1d1e895f01f70ea9a5d0 (patch) | |
tree | 033db8297900477967723c0ad7bb2dc82533b782 /libavcodec | |
parent | 7d8939a0ff7128268a6fc21d9f759ca1ff4d663e (diff) | |
download | ffmpeg-bb5e7d3b5ad21cefee5a1d1e895f01f70ea9a5d0.tar.gz |
avcodec/mationpixels: free memory after malloc failures
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/motionpixels.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/motionpixels.c b/libavcodec/motionpixels.c index 1a62d475c7..8f1362f2b3 100644 --- a/libavcodec/motionpixels.c +++ b/libavcodec/motionpixels.c @@ -68,8 +68,12 @@ static av_cold int mp_decode_init(AVCodecContext *avctx) mp->offset_bits_len = av_log2(avctx->width * avctx->height) + 1; mp->vpt = av_mallocz(avctx->height * sizeof(YuvPixel)); mp->hpt = av_mallocz(h4 * w4 / 16 * sizeof(YuvPixel)); - if (!mp->changes_map || !mp->vpt || !mp->hpt) + if (!mp->changes_map || !mp->vpt || !mp->hpt) { + av_freep(&mp->changes_map); + av_freep(&mp->vpt); + av_freep(&mp->hpt); return AVERROR(ENOMEM); + } avctx->pix_fmt = AV_PIX_FMT_RGB555; avcodec_get_frame_defaults(&mp->frame); return 0; |