[libbluray-devel] Fix leak

hpi1 git at videolan.org
Sun Feb 15 22:45:58 CET 2015


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Sun Feb 15 22:21:46 2015 +0200| [bb09a2e6cd7f1b0cc150381e0d87ce44d3816900] | committer: hpi1

Fix leak

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

 src/libbluray/bdj/native/org_videolan_Libbluray.c |    5 ++++-
 src/libbluray/bluray.c                            |    8 --------
 src/libbluray/bluray_internal.h                   |    3 ---
 3 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/src/libbluray/bdj/native/org_videolan_Libbluray.c b/src/libbluray/bdj/native/org_videolan_Libbluray.c
index fae96c6..b5c62df 100644
--- a/src/libbluray/bdj/native/org_videolan_Libbluray.c
+++ b/src/libbluray/bdj/native/org_videolan_Libbluray.c
@@ -25,6 +25,8 @@
 #include "bdjo.h"
 #include "util.h"
 
+#include "libbluray/bdj/bdjo_parse.h"
+
 #include "libbluray/bluray.h"
 #include "libbluray/bluray_internal.h"
 #include "libbluray/decoders/overlay.h"
@@ -370,9 +372,10 @@ JNIEXPORT jobject JNICALL Java_org_videolan_Libbluray_getBdjoN(JNIEnv * env,
     }
     BD_DEBUG(DBG_JNI, "getBdjoN(%s)\n", file);
 
-    bdjo = bd_bdjo_get(bd, file);
+    bdjo = bdjo_get(bd_get_disc(bd), file);
     if (bdjo) {
         jbdjo = bdjo_make_jobj(env, bdjo);
+        bdjo_free(&bdjo);
     } else {
         BD_DEBUG(DBG_JNI | DBG_CRIT, "getBdjoN(%s) failed\n", file);
     }
diff --git a/src/libbluray/bluray.c b/src/libbluray/bluray.c
index 4f950a2..d96704b 100644
--- a/src/libbluray/bluray.c
+++ b/src/libbluray/bluray.c
@@ -1028,14 +1028,6 @@ uint64_t bd_get_uo_mask(BLURAY *bd)
 #endif
 
 #ifdef USING_BDJAVA
-struct bdjo_data *bd_bdjo_get(struct bluray *bd, const char *file)
-{
-    return bdjo_get(bd->disc, file);
-}
-#endif
-
-
-#ifdef USING_BDJAVA
 void bd_select_rate(BLURAY *bd, float rate, int reason)
 {
     if (reason == BDJ_PLAYBACK_STOP) {
diff --git a/src/libbluray/bluray_internal.h b/src/libbluray/bluray_internal.h
index 3c4e9ff..ea74b48 100644
--- a/src/libbluray/bluray_internal.h
+++ b/src/libbluray/bluray_internal.h
@@ -51,9 +51,6 @@ BD_PRIVATE void     bd_set_bdj_uo_mask(struct bluray *bd, unsigned mask);
  * title selection
  */
 
-struct bdjo_data;
-BD_PRIVATE struct bdjo_data *bd_bdjo_get(struct bluray *bd, const char *file);
-
 BD_PRIVATE int      bd_play_title_internal(struct bluray *bd, unsigned title);
 
 /*



More information about the libbluray-devel mailing list