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

@ -20,6 +20,7 @@
#include "src/utils/filters_utils.h"
#include "src/utils/quant_levels_utils.h"
#include "src/utils/utils.h"
#include "src/webp/encode.h"
#include "src/webp/format_constants.h"
// -----------------------------------------------------------------------------
@ -66,7 +67,7 @@ static int EncodeLossless(const uint8_t* const data, int width, int height,
WebPDispatchAlphaToGreen(data, width, picture.width, picture.height,
picture.argb, picture.argb_stride);
WebPConfigInit(&config);
if (!WebPConfigInit(&config)) return 0;
config.lossless = 1;
// Enable exact, or it would alter RGB values of transparent alpha, which is
// normally OK but not here since we are not encoding the input image but an

View File

@ -1675,7 +1675,9 @@ int VP8LEncodeStream(const WebPConfig* const config,
}
// Avoid "garbage value" error from Clang's static analysis tool.
WebPPictureInit(&picture_side);
if (!WebPPictureInit(&picture_side)) {
goto Error;
}
// Analyze image (entropy, num_palettes etc)
if (!EncoderAnalyze(enc_main, crunch_configs, &num_crunch_configs_main,