[vlc-commits] filter_chain: check filter_owner callbacks

Alexandre Janniaux git at videolan.org
Tue Aug 18 15:09:23 CEST 2020


vlc | branch: master | Alexandre Janniaux <ajanni at videolabs.io> | Tue Jul 28 12:07:45 2020 +0200| [9a6ec6957d7283036efa1d27bf858372d7c417ae] | committer: Alexandre Janniaux

filter_chain: check filter_owner callbacks

sys = chain is guaranteed to be non-null since it's a callback from a
filter_chain_t but the underlying owner can be left zero-initialized in
case there is no decoder device, or dec-dev=none is set so it cannot be
deferenced without checking it first.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9a6ec6957d7283036efa1d27bf858372d7c417ae
---

 src/misc/filter_chain.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/misc/filter_chain.c b/src/misc/filter_chain.c
index 7b1a0ff63b..55f7e07ac2 100644
--- a/src/misc/filter_chain.c
+++ b/src/misc/filter_chain.c
@@ -128,7 +128,9 @@ static picture_t *filter_chain_VideoBufferNew( filter_t *filter )
 static vlc_decoder_device * filter_chain_HoldDecoderDevice(vlc_object_t *o, void *sys)
 {
     filter_chain_t *chain = sys;
-    if (!chain->parent_video_owner.video->hold_device)
+
+    if (chain->parent_video_owner.video == NULL ||
+        chain->parent_video_owner.video->hold_device == NULL)
         return NULL;
 
     return chain->parent_video_owner.video->hold_device(o, chain->parent_video_owner.sys);



More information about the vlc-commits mailing list