diff options
author | James Almer <jamrial@gmail.com> | 2018-02-11 22:50:57 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2018-02-11 22:50:57 -0300 |
commit | 0a320f7e7a9bf8e6e9e9c33adfdb5bea743bfd52 (patch) | |
tree | f80111bebc6ba20dfeb06960ff41269baf20093d /libavutil/hwcontext.c | |
parent | cb2205863b9505441956a459fffe7fed212ea54a (diff) | |
parent | 2eb396b175e55e515aa6a13c5b1789a2a18d3935 (diff) | |
download | ffmpeg-0a320f7e7a9bf8e6e9e9c33adfdb5bea743bfd52.tar.gz |
Merge commit '2eb396b175e55e515aa6a13c5b1789a2a18d3935'
* commit '2eb396b175e55e515aa6a13c5b1789a2a18d3935':
hwcontext: Fix memory leak on derived frame allocation failure
Merged-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavutil/hwcontext.c')
-rw-r--r-- | libavutil/hwcontext.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavutil/hwcontext.c b/libavutil/hwcontext.c index 31ac12807b..70c556ecac 100644 --- a/libavutil/hwcontext.c +++ b/libavutil/hwcontext.c @@ -483,8 +483,10 @@ int av_hwframe_get_buffer(AVBufferRef *hwframe_ref, AVFrame *frame, int flags) ret = av_hwframe_get_buffer(ctx->internal->source_frames, src_frame, 0); - if (ret < 0) + if (ret < 0) { + av_frame_free(&src_frame); return ret; + } ret = av_hwframe_map(frame, src_frame, ctx->internal->source_allocation_map_flags); |