diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-02-22 22:18:26 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-02-22 22:18:26 +0100 |
commit | a6baef6517ec68a8969f3aba04aabd324f6710dd (patch) | |
tree | cdd6371f3dbfce4636263b6fc0850409b5f61c69 | |
parent | 2234a1cd16680df7e15f5b8c44c3caadd22f5d25 (diff) |
avcodec/mpegvideo: Fix memleak of mvs
Fixes CID1271053
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/mpegvideo.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index 837bd0e312..72e7eda36b 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -2225,8 +2225,10 @@ void ff_print_debug_info2(AVCodecContext *avctx, AVFrame *pict, uint8_t *mbskip_ av_log(avctx, AV_LOG_DEBUG, "Adding %d MVs info to frame %d\n", mbcount, avctx->frame_number); sd = av_frame_new_side_data(pict, AV_FRAME_DATA_MOTION_VECTORS, mbcount * sizeof(AVMotionVector)); - if (!sd) + if (!sd) { + av_freep(&mvs); return; + } memcpy(sd->data, mvs, mbcount * sizeof(AVMotionVector)); } |