From 44cfb0119f2a5f7a5a6231507d8b3f16cf7aa453 Mon Sep 17 00:00:00 2001 From: Ilya Shipitsin Date: Fri, 17 Feb 2017 16:52:21 +0500 Subject: [PATCH] revolve possible null pointer dereference found by cppcheck [channels/tsmf/client/gstreamer/tsmf_X11.c:472] -> [channels/tsmf/client/gstreamer/tsmf_X11.c:474]: (warning) Either the condition '!decoder' is redundant or there is possible null pointer dereference: decoder. --- channels/tsmf/client/gstreamer/tsmf_X11.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/channels/tsmf/client/gstreamer/tsmf_X11.c b/channels/tsmf/client/gstreamer/tsmf_X11.c index 89c2eed..7f14103 100644 --- a/channels/tsmf/client/gstreamer/tsmf_X11.c +++ b/channels/tsmf/client/gstreamer/tsmf_X11.c @@ -469,11 +469,12 @@ int tsmf_window_unmap(TSMFGstreamerDecoder* decoder) int tsmf_window_destroy(TSMFGstreamerDecoder* decoder) { struct X11Handle* hdl; - decoder->ready = FALSE; if (!decoder) return -1; + decoder->ready = FALSE; + if (decoder->media_type != TSMF_MAJOR_TYPE_VIDEO) return -3; -- 2.7.4