mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-12 22:14:29 +02:00
make ImgIoUtilReadFile use WebPMalloc instead of malloc
This is a minor technical change in API in case a special allocator was used in WebPMalloc. Change-Id: Idb78a9150d006f158c1a9538525097749e42e7f7
This commit is contained in:
@ -94,7 +94,7 @@ static int ReadPicture(const char* const filename, WebPPicture* const pic,
|
||||
WFPRINTF(stderr, "Error! Could not process file %s\n",
|
||||
(const W_CHAR*)filename);
|
||||
}
|
||||
free((void*)data);
|
||||
WebPFree((void*)data);
|
||||
return ok;
|
||||
}
|
||||
|
||||
@ -121,7 +121,7 @@ static int ReadPicture(const char* const filename, WebPPicture* const pic,
|
||||
WFPRINTF(stderr, "Error! Could not process file %s\n",
|
||||
(const W_CHAR*)filename);
|
||||
}
|
||||
free((void*)data);
|
||||
WebPFree((void*)data);
|
||||
return ok;
|
||||
}
|
||||
|
||||
|
@ -84,7 +84,7 @@ static int ReadImage(const char filename[], WebPPicture* const pic) {
|
||||
if (!ImgIoUtilReadFile(filename, &data, &data_size)) return 0;
|
||||
reader = WebPGuessImageReader(data, data_size);
|
||||
ok = reader(data, data_size, pic, 1, NULL);
|
||||
free((void*)data);
|
||||
WebPFree((void*)data);
|
||||
return ok;
|
||||
}
|
||||
|
||||
|
@ -1011,7 +1011,7 @@ static int Process(const Config* config) {
|
||||
ok = ExUtilReadFileToWebPData(config->args_[0].filename_, &chunk);
|
||||
if (!ok) goto Err2;
|
||||
err = WebPMuxSetChunk(mux, kFourccList[config->type_], &chunk, 1);
|
||||
free((void*)chunk.bytes);
|
||||
WebPDataClear(&chunk);
|
||||
if (err != WEBP_MUX_OK) {
|
||||
ERROR_GOTO3("ERROR (%s): Could not set the %s.\n",
|
||||
ErrorString(err), kDescriptions[config->type_], Err2);
|
||||
|
Reference in New Issue
Block a user