[libbluray-devel] Check for EOF
npzacs
git at videolan.org
Wed Oct 11 09:31:43 CEST 2017
libbluray | branch: master | npzacs <npzacs at gmail.com> | Wed Oct 11 09:44:54 2017 +0300| [b5216adb9af57e3089260132d41d5254de90da68] | committer: npzacs
Check for EOF
> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=b5216adb9af57e3089260132d41d5254de90da68
---
src/libbluray/bdnav/clpi_parse.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/libbluray/bdnav/clpi_parse.c b/src/libbluray/bdnav/clpi_parse.c
index 6cf4f862..312c10f3 100644
--- a/src/libbluray/bdnav/clpi_parse.c
+++ b/src/libbluray/bdnav/clpi_parse.c
@@ -117,6 +117,11 @@ _parse_header(BITSTREAM *bits, CLPI_CL *cl)
return 0;
}
+ if (bs_avail(bits) < 5 * 32) {
+ BD_DEBUG(DBG_NAV | DBG_CRIT, "_parse_header: unexpected end of file\n");
+ return 0;
+ }
+
cl->sequence_info_start_addr = bs_read(bits, 32);
cl->program_info_start_addr = bs_read(bits, 32);
cl->cpi_start_addr = bs_read(bits, 32);
More information about the libbluray-devel
mailing list