diff options
author | Eirik Aavitsland <eirik.aavitsland@qt.io> | 2023-07-04 11:19:30 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-07-04 11:16:58 +0000 |
commit | 4496d0399b6adf59c3e07e272d1358d6ea5475af (patch) | |
tree | d5902ced3175ee34cff2eba5a87c0188be1a0343 /src/3rdparty/libwebp/src/enc/webp_enc.c | |
parent | 5464b869abbf6c44bd8a8e283c0e09206f49061a (diff) |
Update bundled libwebp to version 1.3.1
[ChangeLog][Third-Party Code] Update bundled libwebp to version 1.3.1
Change-Id: I04b4a9fdb8da7cd3627d4ffaa15326c85858c425
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 32d5b3dcd33c2ae724a13040838313f96cf07966)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/3rdparty/libwebp/src/enc/webp_enc.c')
-rw-r--r-- | src/3rdparty/libwebp/src/enc/webp_enc.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/3rdparty/libwebp/src/enc/webp_enc.c b/src/3rdparty/libwebp/src/enc/webp_enc.c index 9620e05..583fe6a 100644 --- a/src/3rdparty/libwebp/src/enc/webp_enc.c +++ b/src/3rdparty/libwebp/src/enc/webp_enc.c @@ -307,7 +307,10 @@ int WebPEncodingSetError(const WebPPicture* const pic, WebPEncodingError error) { assert((int)error < VP8_ENC_ERROR_LAST); assert((int)error >= VP8_ENC_OK); - ((WebPPicture*)pic)->error_code = error; + // The oldest error reported takes precedence over the new one. + if (pic->error_code == VP8_ENC_OK) { + ((WebPPicture*)pic)->error_code = error; + } return 0; } @@ -317,8 +320,7 @@ int WebPReportProgress(const WebPPicture* const pic, *percent_store = percent; if (pic->progress_hook && !pic->progress_hook(percent, pic)) { // user abort requested - WebPEncodingSetError(pic, VP8_ENC_ERROR_USER_ABORT); - return 0; + return WebPEncodingSetError(pic, VP8_ENC_ERROR_USER_ABORT); } } return 1; // ok @@ -329,7 +331,7 @@ int WebPEncode(const WebPConfig* config, WebPPicture* pic) { int ok = 0; if (pic == NULL) return 0; - WebPEncodingSetError(pic, VP8_ENC_OK); // all ok so far + pic->error_code = VP8_ENC_OK; // all ok so far if (config == NULL) { // bad params return WebPEncodingSetError(pic, VP8_ENC_ERROR_NULL_PARAMETER); } |