Skip to content

avcodec: vaapi: fix probable data race

Thomas Guillem requested to merge tguillem/vlc:vaapi-fix-race into master

av_frame_free() will release an HW av_frame triggering the "av_hwframe_get_buffer(ctx->hw_frames_ctx, frame, 0)) == AVERROR(ENOMEM)" condition from Get().

Add a missing lock to protect av_frame_free() and vlc_cond_signal().

Fixes #26166 (closed)

Note: Ideally, we should use a semaphore initialized with the good hw_frames count, but I didn't find a way to get it from the public API.

Merge request reports