Commit 15a8bbd0 authored by Petri Hintukainen's avatar Petri Hintukainen

Fix lba range check (end-of-file)

parent 19325756
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment