History

vulkan: zero out AVBufferRef in case of failure

This resulted in uninit errors and was never caught as we generally did not use massive allocations before.

Lynne committed 1 year ago

Commit 86e55251 parent f582de81 file · +4 −0Browse files

Unified · Split

libavutil/vulkan.c+4−0
@@ -1213,6 +1213,8 @@ int ff_vk_get_pooled_buffer(FFVulkanContext *ctx, AVBufferPool **buf_pool, · 1212 unmodified lines
1213 AVBufferRef *ref;1213 AVBufferRef *ref;
1214 FFVkBuffer *data;1214 FFVkBuffer *data;
1215 1215
1216 *buf = NULL;
1217
1216 if (!(*buf_pool)) {1218 if (!(*buf_pool)) {
1217 *buf_pool = av_buffer_pool_init2(sizeof(FFVkBuffer), ctx,1219 *buf_pool = av_buffer_pool_init2(sizeof(FFVkBuffer), ctx,
1218 alloc_data_buf, NULL);1220 alloc_data_buf, NULL);
@@ -1239,6 +1241,7 @@ int ff_vk_get_pooled_buffer(FFVulkanContext *ctx, AVBufferPool **buf_pool, · 20 unmodified lines
1239 mem_props);1241 mem_props);
1240 if (err < 0) {1242 if (err < 0) {
1241 av_buffer_unref(&ref);1243 av_buffer_unref(&ref);
1244 *buf = NULL;
1242 return err;1245 return err;
1243 }1246 }
1244 1247
@@ -1246,6 +1249,7 @@ int ff_vk_get_pooled_buffer(FFVulkanContext *ctx, AVBufferPool **buf_pool, · 1 unmodified line
1246 err = ff_vk_map_buffer(ctx, data, &data->mapped_mem, 0);1249 err = ff_vk_map_buffer(ctx, data, &data->mapped_mem, 0);
1247 if (err < 0) {1250 if (err < 0) {
1248 av_buffer_unref(&ref);1251 av_buffer_unref(&ref);
1252 *buf = NULL;
1249 return err;1253 return err;
1250 }1254 }
1251 }1255 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t