Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
Master
-
None
-
None
-
Android 7.1.1
Description
When reader.readAsText is called with an URI pointing to a local asset with a size greater than READ_CHUNK_SIZE = 256 * 1024, loading produces corrupt data.
The behaviour is caused by a negative length returned by CordovaResourceApi.openForRead() when the URI is a URI_TYPE_ASSET. Given the negative length, Filesystem.readFileAtURL() returns the whole file instead of the desired part and FileReader.readSuccessCallback() does not check the returned buffer size. Hence, the following chunks are attated to the buffer regardless of whether the file was already completely read.