Fix bug related to EOF in Android FileAccess
This commit is contained in:
parent
d199ed344d
commit
c9852501a4
1 changed files with 7 additions and 1 deletions
|
@ -132,12 +132,18 @@ int FileAccessAndroid::get_buffer(uint8_t *p_dst, int p_length) const {
|
|||
|
||||
|
||||
off_t r = AAsset_read(a,p_dst,p_length);
|
||||
|
||||
if (pos+p_length >len ) {
|
||||
eof=true;
|
||||
}
|
||||
|
||||
if (r>=0) {
|
||||
|
||||
pos+=r;
|
||||
if (pos>len) {
|
||||
pos=len;
|
||||
eof=true;
|
||||
}
|
||||
|
||||
}
|
||||
return r;
|
||||
|
||||
|
|
Loading…
Reference in a new issue