From cf56f0426379c91854feb7d323d01d0035edaed3 Mon Sep 17 00:00:00 2001 From: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com> Date: Tue, 8 Mar 2022 13:19:59 -0500 Subject: [PATCH] directrenderer: handle pull callback failure If the frameBufferRequested signal fails to set the AVFrame data pointer, return null. Change-Id: Iefb0d4670ca5e94c6ace2759fc941b9af39e682e --- src/directrenderer.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/directrenderer.cpp b/src/directrenderer.cpp index 7c77298a..5889783a 100644 --- a/src/directrenderer.cpp +++ b/src/directrenderer.cpp @@ -3,7 +3,7 @@ * Author: Alexandre Lision <alexandre.lision@savoirfairelinux.com> * Author: Guillaume Roguez <guillaume.roguez@savoirfairelinux.com> * Author: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com> - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -68,6 +68,10 @@ public: // Important: Subscription to this signal MUST be synchronous(Qt::DirectConnection). Q_EMIT parent_->frameBufferRequested(frameBufferPtr->avframe.get()); + if (frameBufferPtr->avframe->data[0] == nullptr) { + return nullptr; + } + return std::move(frameBufferPtr); }; -- GitLab