mirror of
https://github.com/webmproject/libwebp.git
synced 2024-11-19 20:08:28 +01:00
wicdec,icc: treat unsupported op as non-fatal
ICC extraction via GetColorContexts may fail due to the operation not being supported with e.g., bitmaps. Bug: webp:506 Change-Id: I587220e688ac90d77c84af21c9e7bc8bf178f3aa
This commit is contained in:
parent
b78494a933
commit
b27ea8525a
@ -134,7 +134,10 @@ static HRESULT ExtractICCP(IWICImagingFactory* const factory,
|
||||
IWICColorContext** color_contexts;
|
||||
|
||||
IFS(IWICBitmapFrameDecode_GetColorContexts(frame, 0, NULL, &count));
|
||||
if (FAILED(hr) || count == 0) return hr;
|
||||
if (FAILED(hr) || count == 0) {
|
||||
// Treat unsupported operation as a non-fatal error. See crbug.com/webp/506.
|
||||
return (hr == WINCODEC_ERR_UNSUPPORTEDOPERATION) ? S_OK : hr;
|
||||
}
|
||||
|
||||
color_contexts = (IWICColorContext**)calloc(count, sizeof(*color_contexts));
|
||||
if (color_contexts == NULL) return E_OUTOFMEMORY;
|
||||
|
Loading…
Reference in New Issue
Block a user