[libbluray-devel] Check for graphics controller (!= NULL) at entry points

hpi1 git at videolan.org
Wed Feb 9 17:22:38 CET 2011


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Wed Feb  9 18:21:48 2011 +0200| [b2fb25b9b9a54979e3f0821d026929c427620ddf] | committer: hpi1

Check for graphics controller (!= NULL) at entry points

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=b2fb25b9b9a54979e3f0821d026929c427620ddf
---

 src/libbluray/decoders/graphics_controller.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/src/libbluray/decoders/graphics_controller.c b/src/libbluray/decoders/graphics_controller.c
index fd41b61..f352b02 100644
--- a/src/libbluray/decoders/graphics_controller.c
+++ b/src/libbluray/decoders/graphics_controller.c
@@ -270,6 +270,11 @@ void gc_free(GRAPHICS_CONTROLLER **p)
 
 void gc_decode_ts(GRAPHICS_CONTROLLER *gc, uint16_t pid, uint8_t *block, unsigned num_blocks, int64_t stc)
 {
+    if (!gc) {
+        TRACE("gc_decode_ts(): no graphics controller\n");
+        return;
+    }
+
     if (pid >= 0x1400 && pid < 0x1500) {
         /* IG stream */
 
@@ -774,6 +779,11 @@ int gc_run(GRAPHICS_CONTROLLER *gc, gc_ctrl_e ctrl, uint32_t param, GC_NAV_CMDS
         cmds->sound_id_ref = -1;
     }
 
+    if (!gc) {
+        TRACE("gc_run(): no graphics controller\n");
+        return result;
+    }
+
     bd_mutex_lock(&gc->mutex);
 
     /* always accept reset */
@@ -787,7 +797,7 @@ int gc_run(GRAPHICS_CONTROLLER *gc, gc_ctrl_e ctrl, uint32_t param, GC_NAV_CMDS
     }
 
     /* other operations require complete display set */
-    if (!gc || !gc->igs || !gc->igs->ics || !gc->igs->complete) {
+    if (!gc->igs || !gc->igs->ics || !gc->igs->complete) {
         TRACE("gc_run(): no interactive composition\n");
         bd_mutex_unlock(&gc->mutex);
         return result;



More information about the libbluray-devel mailing list