[libbluray-devel] Fixed types

hpi1 git at videolan.org
Mon Jan 21 13:42:12 CET 2013


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Mon Jan 21 14:26:09 2013 +0200| [df90c877d096cc709efdc0b281b09b846af5e3a1] | committer: hpi1

Fixed types

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

 src/libbluray/bdj/bdjo_parser.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/libbluray/bdj/bdjo_parser.c b/src/libbluray/bdj/bdjo_parser.c
index 5a628e6..0abb579 100644
--- a/src/libbluray/bdj/bdjo_parser.c
+++ b/src/libbluray/bdj/bdjo_parser.c
@@ -419,15 +419,16 @@ jobject bdjo_read(JNIEnv* env, const char* file)
     } else {
         file_seek(handle, 0, SEEK_SET);
 
-        uint8_t *data = malloc(length);
-        int64_t size_read = file_read(handle, data, length);
+        size_t size = (size_t)length;
+        uint8_t *data = malloc(size);
+        size_t size_read = file_read(handle, data, size);
 
-        if (size_read < length) {
+        if (size_read != size) {
             BD_DEBUG(DBG_BDJ | DBG_CRIT, "Error reading %s\n", file);
 
         } else {
             BITBUFFER *buf = malloc(sizeof(BITBUFFER));
-            bb_init(buf, data, length);
+            bb_init(buf, data, size);
 
             result = _parse_bdjo(env, buf);
 



More information about the libbluray-devel mailing list