mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2026-11-06 05:17:42 +00:00
fill_model_input_tf() pops a LastLevelTaskItem from lltask_queue and stores it in request->lltask, but nothing frees it once the inference has completed. The next fill_model_input_tf() on the same request just overwrites the pointer, so only the last lltask of each request is released, by destroy_request_item() when the model is freed. Every inference therefore leaks one lltask, apart from the last one of each of the nireq requests, with both async=0 and async=1. Free it in infer_completion_callback() before the request is pushed back to request_queue, as the OpenVINO backend does in its completion callback. Also free it on the failure paths of execute_model_tf() and dnn_flush_tf(), where the popped lltask is dropped in the same way. No inference thread is running on any of these paths. av_freep() resets the pointer, so the av_freep() in destroy_request_item() is still safe. Signed-off-by: Jake Fineman <jake@wave.online>