[libbluray-devel] Fix lba range check (end-of-file)
Petri Hintukainen
git at videolan.org
Sun Jun 26 11:35:16 CEST 2016
libudfread | branch: master | Petri Hintukainen <phintuka at gmail.com> | Sun Jun 26 12:34:33 2016 +0300| [15a8bbd0a2f64f429e83016cf45943d91650dfc8] | committer: Petri Hintukainen
Fix lba range check (end-of-file)
> http://git.videolan.org/gitweb.cgi/libudfread.git/?a=commit;h=15a8bbd0a2f64f429e83016cf45943d91650dfc8
---
src/udfread.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/udfread.c b/src/udfread.c
index b59f228..ba43801 100644
--- a/src/udfread.c
+++ b/src/udfread.c
@@ -1420,7 +1420,7 @@ uint32_t udfread_read_blocks(UDFFILE *p, void *buf, uint32_t file_block, uint32_
if (!lba) {
/* unallocated/unwritten block or EOF */
uint32_t file_blocks = (udfread_file_size(p) + UDF_BLOCK_SIZE - 1) / UDF_BLOCK_SIZE;
- if (file_block + i >= file_blocks) {
+ if (file_block + i < file_blocks) {
udf_trace("zero-fill unallocated / unwritten block %u\n", file_block + i);
memset(block, 0, UDF_BLOCK_SIZE);
continue;
More information about the libbluray-devel
mailing list