Date: Sun, 3 Apr 2011 22:53:33 +0200

Cppcheck reports the following.

        $ cppcheck --version
        Cppcheck 1.47
        $ cppcheck .
        […]
        Checking ./PLUGINS/src/osddemo/osddemo.c...
        [./PLUGINS/src/osddemo/osddemo.c:8]: (debug) Include file: "vdr/osd.h" 
not found.
        [./PLUGINS/src/osddemo/osddemo.c:9]: (debug) Include file: 
"vdr/plugin.h" not found.
        [./PLUGINS/src/osddemo/osddemo.c:270]: (error) Possible null pointer 
dereference: NextPixmap
        […]

`CreateTextPixmap` can indeed assign `NULL` to `NextPixmap` and right before in 
line 265 the same check is performed.

Signed-off-by: Paul Menzel <paulepan...@users.sourceforge.net>
CC: Klaus Schmidinger <klaus.schmidin...@tvdr.de>
---
 PLUGINS/src/osddemo/osddemo.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/PLUGINS/src/osddemo/osddemo.c b/PLUGINS/src/osddemo/osddemo.c
index 2e6a33b..d3ec718 100644
--- a/PLUGINS/src/osddemo/osddemo.c
+++ b/PLUGINS/src/osddemo/osddemo.c
@@ -267,7 +267,9 @@ void cTrueColorDemo::Action(void)
                              }
                           Start = cTimeMs::Now();
                           StartLine = Line;
-                          Line += NextPixmap->DrawPort().Height();
+                          if (NextPixmap) {
+                             Line += NextPixmap->DrawPort().Height();
+                             }
                           }
                        State++;
                      }
-- 
1.7.4.1

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr

Reply via email to