From 54590472a7f546926b2fce37fb3e7525cd3d7c45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 21 Sep 2022 11:39:34 +0200 Subject: [PATCH] winegstreamer: Avoid accessing NULL pointer if transform didn't provide a sample. This can happen with asynchronous decoding, such as with the VA-API decodebin plugin for H264. --- dlls/winegstreamer/wg_allocator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/winegstreamer/wg_allocator.c b/dlls/winegstreamer/wg_allocator.c index 5b2c48dcf77..784677e2b2d 100644 --- a/dlls/winegstreamer/wg_allocator.c +++ b/dlls/winegstreamer/wg_allocator.c @@ -164,7 +164,7 @@ static GstMemory *wg_allocator_alloc(GstAllocator *gst_allocator, gsize size, pthread_mutex_lock(&allocator->mutex); sample = allocator->request_sample(size, allocator->request_sample_context); - if (sample->max_size < size) + if (sample && sample->max_size < size) InterlockedDecrement(&sample->refcount); else memory->sample = sample;