diff mbox series

[FFmpeg-devel,1/5] avutil/hwcontext_vulkan: Remove redundant resetting

Message ID GV1P250MB0737A13FAF37F2AD151AE9E88FF7A@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit a6bd2ee7594c8625d4fd3b56e2d7c67b23c36580
Headers show
Series [FFmpeg-devel,1/5] avutil/hwcontext_vulkan: Remove redundant resetting | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt Sept. 14, 2023, 11:44 p.m. UTC
vulkan_free_internal() already resets the AVVkFrame.internal
pointer.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
1. I find it odd that the frame's internal is freed without
the frame itself being freed; vulkan_frame_free() expects
the internal to be present and seems to NPD if not.

(Actually, I was about to allocate AVVkFrames together
with their internal when I found out that their lifetime
was different.)

2. I have only tested that these patches compile, nothing more.

 libavutil/hwcontext_vulkan.c | 2 --
 1 file changed, 2 deletions(-)
diff mbox series

Patch

diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c
index 711a32a0ac..c783080567 100644
--- a/libavutil/hwcontext_vulkan.c
+++ b/libavutil/hwcontext_vulkan.c
@@ -3065,7 +3065,6 @@  static int vulkan_transfer_data_from_cuda(AVHWFramesContext *hwfc,
 fail:
     CHECK_CU(cu->cuCtxPopCurrent(&dummy));
     vulkan_free_internal(dst_f);
-    dst_f->internal = NULL;
     av_buffer_unref(&dst->buf[0]);
     return err;
 }
@@ -3642,7 +3641,6 @@  static int vulkan_transfer_data_to_cuda(AVHWFramesContext *hwfc, AVFrame *dst,
 fail:
     CHECK_CU(cu->cuCtxPopCurrent(&dummy));
     vulkan_free_internal(dst_f);
-    dst_f->internal = NULL;
     av_buffer_unref(&dst->buf[0]);
     return err;
 }