Fix read archive

This commit is contained in:
tarsin committed 2022-09-23 09:20:15 +08:00
1 parent 586ad66bff
commit bc08a09621
1 file changed
+1 -2
+1 -2
View File
@@ -258,12 +258,11 @@ Java_com_hippo_UriArchiveAccessor_extractToAddr(JNIEnv *env, jobject thiz, jint
long long size = archive_entry_size(ctx->entry);
void *buffer = malloc(size + sizeof(long long));
if (!buffer) {
*(long long *) buffer = size;
ctx->using = 0;
LOGE("Allocate buffer for decompression failed:ENOMEM");
free(buffer);
return 0;
}
*(long long *) buffer = size;
ret = archive_read_data(ctx->arc, buffer + sizeof(long long), size);
ctx->using = 0;
if (ret == size)