[libbluray-devel] Check for EOF
npzacs
git at videolan.org
Wed Oct 11 09:18:52 CEST 2017
libbluray | branch: master | npzacs <npzacs at gmail.com> | Wed Oct 11 09:44:54 2017 +0300| [b26de025f9d38e2817cf820adf8b12f76131772c] | committer: hpi1
Check for EOF
> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=b26de025f9d38e2817cf820adf8b12f76131772c
---
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