mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-13 06:24:27 +02:00
Remove support for partial files in Mux.
Change-Id: Ie084f308c79a3cfaf2ea13e800397debc2643470
This commit is contained in:
@ -325,17 +325,13 @@ static int ReadFileToWebPData(const char* const filename,
|
||||
}
|
||||
|
||||
static int CreateMux(const char* const filename, WebPMux** mux) {
|
||||
WebPMuxState mux_state;
|
||||
WebPData bitstream;
|
||||
|
||||
assert(mux != NULL);
|
||||
|
||||
if (!ReadFileToWebPData(filename, &bitstream)) return 0;
|
||||
*mux = WebPMuxCreate(&bitstream, 1, &mux_state);
|
||||
*mux = WebPMuxCreate(&bitstream, 1);
|
||||
free((void*)bitstream.bytes_);
|
||||
if (*mux != NULL && mux_state == WEBP_MUX_STATE_COMPLETE) return 1;
|
||||
fprintf(stderr, "Failed to create mux object from file %s. mux_state = %d.\n",
|
||||
filename, mux_state);
|
||||
if (*mux != NULL) return 1;
|
||||
fprintf(stderr, "Failed to create mux object from file %s.\n", filename);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -345,15 +341,12 @@ static int ReadImage(const char* filename,
|
||||
WebPMux* mux;
|
||||
WebPMuxError err;
|
||||
int ok = 0;
|
||||
WebPMuxState mux_state;
|
||||
|
||||
if (!ReadFileToWebPData(filename, &bitstream)) return 0;
|
||||
mux = WebPMuxCreate(&bitstream, 1, &mux_state);
|
||||
mux = WebPMuxCreate(&bitstream, 1);
|
||||
free((void*)bitstream.bytes_);
|
||||
if (mux == NULL || mux_state != WEBP_MUX_STATE_COMPLETE) {
|
||||
fprintf(stderr,
|
||||
"Failed to create mux object from file %s. mux_state = %d.\n",
|
||||
filename, mux_state);
|
||||
if (mux == NULL) {
|
||||
fprintf(stderr, "Failed to create mux object from file %s.\n", filename);
|
||||
return 0;
|
||||
}
|
||||
err = WebPMuxGetImage(mux, &image, &alpha);
|
||||
|
Reference in New Issue
Block a user