diff options
author | K. S. Ernest (iFire) Lee <ernest.lee@chibifire.com> | 2022-03-08 04:56:23 -0800 |
---|---|---|
committer | K. S. Ernest (iFire) Lee <ernest.lee@chibifire.com> | 2022-03-08 06:30:31 -0800 |
commit | f7a809603c4f14b2e05e78385d6f9cdbdfde5072 (patch) | |
tree | b2ff9fa9e1e86fe817aa8aab115ef12000e6c589 /thirdparty/thorvg/src/loaders/external_png | |
parent | 86b0faf2ec3b76a09e898fcaa7dbfdd56189bed8 (diff) |
ThorVG: Sync with upstream 0.8.0
Diffstat (limited to 'thirdparty/thorvg/src/loaders/external_png')
-rw-r--r-- | thirdparty/thorvg/src/loaders/external_png/tvgPngLoader.cpp | 7 | ||||
-rw-r--r-- | thirdparty/thorvg/src/loaders/external_png/tvgPngLoader.h | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/thirdparty/thorvg/src/loaders/external_png/tvgPngLoader.cpp b/thirdparty/thorvg/src/loaders/external_png/tvgPngLoader.cpp index c3d281482a..05db65cb23 100644 --- a/thirdparty/thorvg/src/loaders/external_png/tvgPngLoader.cpp +++ b/thirdparty/thorvg/src/loaders/external_png/tvgPngLoader.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2021 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2020 - 2022 Samsung Electronics Co., Ltd. All rights reserved. * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -93,7 +93,10 @@ bool PngLoader::read() png_image_free(image); return false; } - if (!png_image_finish_read(image, NULL, buffer, 0, NULL)) return false; + if (!png_image_finish_read(image, NULL, buffer, 0, NULL)) { + free(buffer); + return false; + } content = reinterpret_cast<uint32_t*>(buffer); _premultiply(reinterpret_cast<uint32_t*>(buffer), image->width, image->height); diff --git a/thirdparty/thorvg/src/loaders/external_png/tvgPngLoader.h b/thirdparty/thorvg/src/loaders/external_png/tvgPngLoader.h index b42537c73f..8beff0a3b3 100644 --- a/thirdparty/thorvg/src/loaders/external_png/tvgPngLoader.h +++ b/thirdparty/thorvg/src/loaders/external_png/tvgPngLoader.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2021 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2020 - 2022 Samsung Electronics Co., Ltd. All rights reserved. * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal |