mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-28 06:38:20 +01:00
make ExUtilLoadWebP() accept NULL bitstream param.
Change-Id: Ifce379873ca39e46d011a1cb829beab89de5f15d
This commit is contained in:
parent
9c0a60ccb3
commit
f0b65c9a1e
@ -131,8 +131,13 @@ int ExUtilLoadWebP(const char* const in_file,
|
|||||||
const uint8_t** data, size_t* data_size,
|
const uint8_t** data, size_t* data_size,
|
||||||
WebPBitstreamFeatures* bitstream) {
|
WebPBitstreamFeatures* bitstream) {
|
||||||
VP8StatusCode status;
|
VP8StatusCode status;
|
||||||
|
WebPBitstreamFeatures local_features;
|
||||||
if (!ExUtilReadFile(in_file, data, data_size)) return 0;
|
if (!ExUtilReadFile(in_file, data, data_size)) return 0;
|
||||||
|
|
||||||
|
if (bitstream == NULL) {
|
||||||
|
bitstream = &local_features;
|
||||||
|
}
|
||||||
|
|
||||||
status = WebPGetFeatures(*data, *data_size, bitstream);
|
status = WebPGetFeatures(*data, *data_size, bitstream);
|
||||||
if (status != VP8_STATUS_OK) {
|
if (status != VP8_STATUS_OK) {
|
||||||
free((void*)*data);
|
free((void*)*data);
|
||||||
|
@ -47,7 +47,7 @@ int ExUtilWriteFile(const char* const file_name,
|
|||||||
void ExUtilPrintWebPError(const char* const in_file, int status);
|
void ExUtilPrintWebPError(const char* const in_file, int status);
|
||||||
|
|
||||||
// Reads a WebP from 'in_file', returning the contents and size in 'data' and
|
// Reads a WebP from 'in_file', returning the contents and size in 'data' and
|
||||||
// 'data_size'. 'bitstream' is populated using WebPGetFeatures().
|
// 'data_size'. If not NULL, 'bitstream' is populated using WebPGetFeatures().
|
||||||
// Returns true on success.
|
// Returns true on success.
|
||||||
int ExUtilLoadWebP(const char* const in_file,
|
int ExUtilLoadWebP(const char* const in_file,
|
||||||
const uint8_t** data, size_t* data_size,
|
const uint8_t** data, size_t* data_size,
|
||||||
|
Loading…
Reference in New Issue
Block a user