hwcontext: Fix memory leak on derived frame allocation failure
This commit is contained in:
parent
96e476cc9d
commit
2eb396b175
@ -470,8 +470,10 @@ int av_hwframe_get_buffer(AVBufferRef *hwframe_ref, AVFrame *frame, int flags)
|
|||||||
|
|
||||||
ret = av_hwframe_get_buffer(ctx->internal->source_frames,
|
ret = av_hwframe_get_buffer(ctx->internal->source_frames,
|
||||||
src_frame, 0);
|
src_frame, 0);
|
||||||
if (ret < 0)
|
if (ret < 0) {
|
||||||
|
av_frame_free(&src_frame);
|
||||||
return ret;
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
ret = av_hwframe_map(frame, src_frame,
|
ret = av_hwframe_map(frame, src_frame,
|
||||||
ctx->internal->source_allocation_map_flags);
|
ctx->internal->source_allocation_map_flags);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user