Add a WEBP_NODISCARD

Change-Id: Ice66f2aa6358474d728fb19c571edc86ed139a49
This commit is contained in:
Vincent Rabaud
2023-11-10 13:57:07 +01:00
parent 24d7f9cb6e
commit 13d9c30b2b
25 changed files with 321 additions and 222 deletions

View File

@ -98,7 +98,11 @@ int main(int argc, const char* argv[]) {
for (i = 0; !error && i < image.num_frames; ++i) {
W_CHAR out_file[1024];
WebPDecBuffer buffer;
WebPInitDecBuffer(&buffer);
if (!WebPInitDecBuffer(&buffer)) {
fprintf(stderr, "Cannot init dec buffer\n");
error = 1;
continue;
}
buffer.colorspace = MODE_RGBA;
buffer.is_external_memory = 1;
buffer.width = image.canvas_width;

View File

@ -613,7 +613,7 @@ int main(int argc, char* argv[]) {
// Position iterator to last frame. Next call to HandleDisplay will wrap over.
// We take this into account by bumping up loop_count.
WebPDemuxGetFrame(kParams.dmux, 0, curr);
if (!WebPDemuxGetFrame(kParams.dmux, 0, curr)) goto Error;
if (kParams.loop_count) ++kParams.loop_count;
#if defined(__unix__) || defined(__CYGWIN__)