[libbluray-devel] Added limit for .bdjo file size
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:24:46 2013 +0200| [1db6c94fe5fd62f5d75cefa4e880ae048f7668d7] | committer: hpi1
Added limit for .bdjo file size
> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=1db6c94fe5fd62f5d75cefa4e880ae048f7668d7
---
src/libbluray/bdj/bdjo_parser.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/libbluray/bdj/bdjo_parser.c b/src/libbluray/bdj/bdjo_parser.c
index 131e9bd..5a628e6 100644
--- a/src/libbluray/bdj/bdjo_parser.c
+++ b/src/libbluray/bdj/bdjo_parser.c
@@ -29,6 +29,8 @@
#include "util/macro.h"
#include "bdj_util.h"
+#define MAX_BDJO_FILE_SIZE 0xffff
+
/* Documentation: HD Cookbook
* https://hdcookbook.dev.java.net/
*/
@@ -411,7 +413,7 @@ jobject bdjo_read(JNIEnv* env, const char* file)
file_seek(handle, 0, SEEK_END);
int64_t length = file_tell(handle);
- if (length <= 0) {
+ if (length <= 0 || length > MAX_BDJO_FILE_SIZE) {
BD_DEBUG(DBG_BDJ | DBG_CRIT, "Error reading %s\n", file);
} else {
More information about the libbluray-devel
mailing list