Fix archive code error (#289)

This commit is contained in:
txyyh authored and GitHub committed 2022-09-21 08:56:56 +08:00
1 parent 3b96328765
commit 9251ed238c
1 file changed
+1 -1
+1 -1
View File
@@ -257,8 +257,8 @@ Java_com_hippo_UriArchiveAccessor_extractToAddr(JNIEnv *env, jobject thiz, jint
return 0;
long long size = archive_entry_size(ctx->entry);
void *buffer = malloc(size + sizeof(long long));
*(long long *) buffer = size;
if (!buffer) {
*(long long *) buffer = size;
ctx->using = 0;
LOGE("Allocate buffer for decompression failed:ENOMEM");
free(buffer);