Browse Source

Merge pull request #53434 from Faless/io/4.x_file_access_compressed

[File] Fix FileAccessCompressed::get_buffer return value.
Rémi Verschelde 3 years ago
parent
commit
0157742422
1 changed files with 2 additions and 2 deletions
  1. 2 2
      core/io/file_access_compressed.cpp

+ 2 - 2
core/io/file_access_compressed.cpp

@@ -312,10 +312,10 @@ uint64_t FileAccessCompressed::get_buffer(uint8_t *p_dst, uint64_t p_length) con
 			} else {
 			} else {
 				read_block--;
 				read_block--;
 				at_end = true;
 				at_end = true;
-				if (i < p_length - 1) {
+				if (i + 1 < p_length) {
 					read_eof = true;
 					read_eof = true;
 				}
 				}
-				return i;
+				return i + 1;
 			}
 			}
 		}
 		}
 	}
 	}