This resulted in uninit errors and was never caught as we generally did not use massive allocations before.
Unified · Split
| @@ -1213,6 +1213,8 @@ int ff_vk_get_pooled_buffer(FFVulkanContext *ctx, AVBufferPool **buf_pool, · 1212 unmodified lines | ||
| 1213 | 1213 | AVBufferRef *ref; |
| 1214 | 1214 | FFVkBuffer *data; |
| 1215 | 1215 | |
| 1216 | + *buf = NULL; | |
| 1217 | + | |
| 1216 | 1218 | if (!(*buf_pool)) { |
| 1217 | 1219 | *buf_pool = av_buffer_pool_init2(sizeof(FFVkBuffer), ctx, |
| 1218 | 1220 | alloc_data_buf, NULL); |
| @@ -1239,6 +1241,7 @@ int ff_vk_get_pooled_buffer(FFVulkanContext *ctx, AVBufferPool **buf_pool, · 20 unmodified lines | ||
| 1239 | 1241 | mem_props); |
| 1240 | 1242 | if (err < 0) { |
| 1241 | 1243 | av_buffer_unref(&ref); |
| 1244 | + *buf = NULL; | |
| 1242 | 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 | 1249 | err = ff_vk_map_buffer(ctx, data, &data->mapped_mem, 0); |
| 1247 | 1250 | if (err < 0) { |
| 1248 | 1251 | av_buffer_unref(&ref); |
| 1252 | + *buf = NULL; | |
| 1249 | 1253 | return err; |
| 1250 | 1254 | } |
| 1251 | 1255 | } |