diff --git a/tiny_gltf.h b/tiny_gltf.h index 710e9d9..2b0e674 100644 --- a/tiny_gltf.h +++ b/tiny_gltf.h @@ -2592,11 +2592,12 @@ bool ReadWholeFile(std::vector *out, std::string *err, return false; } size_t size = AAsset_getLength(asset); - if (size <= 0) { + if (size == 0) { if (err) { (*err) += "Invalid file size : " + filepath + " (does the path point to a directory?)"; } + return false; } out->resize(size); AAsset_read(asset, reinterpret_cast(&out->at(0)), size);