[libbluray-devel] BD-J: moved IG overlay buffer check after locking the buffer

hpi1 git at videolan.org
Sat Nov 9 09:35:58 CET 2013


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Sat Nov  9 10:31:20 2013 +0200| [66740ed15fae46fc43b9a688618eda4c1315d129] | committer: hpi1

BD-J: moved IG overlay buffer check after locking the buffer

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

 src/libbluray/bdj/native/org_videolan_Libbluray.c |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/libbluray/bdj/native/org_videolan_Libbluray.c b/src/libbluray/bdj/native/org_videolan_Libbluray.c
index 8757671..6605db0 100644
--- a/src/libbluray/bdj/native/org_videolan_Libbluray.c
+++ b/src/libbluray/bdj/native/org_videolan_Libbluray.c
@@ -411,7 +411,7 @@ JNIEXPORT void JNICALL Java_org_videolan_Libbluray_updateGraphicN(JNIEnv * env,
         return;
     }
 
-    if (bdj->buf && bdj->buf->buf[BD_OVERLAY_IG]) {
+    if (bdj->buf) {
 
         /* copy to application-allocated buffer */
 
@@ -424,9 +424,17 @@ JNIEXPORT void JNICALL Java_org_videolan_Libbluray_updateGraphicN(JNIEnv * env,
         bdj->buf->dirty[BD_OVERLAY_IG].y0 = y0;
         bdj->buf->dirty[BD_OVERLAY_IG].y1 = y1;
 
+        /* get buffer */
         if (bdj->buf->lock) {
             bdj->buf->lock(bdj->buf);
         }
+        if (!bdj->buf->buf[BD_OVERLAY_IG]) {
+            BD_DEBUG(DBG_BDJ | DBG_CRIT, "ARGB frame buffer missing\n");
+            if (bdj->buf->unlock) {
+                bdj->buf->unlock(bdj->buf);
+            }
+            return;
+        }
 
         /* check buffer size */
 



More information about the libbluray-devel mailing list