diff options
author | Wan-Teh Chang <wtc@google.com> | 2023-11-03 14:23:15 -0700 |
---|---|---|
committer | libyuv LUCI CQ <libyuv-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-11-03 23:53:24 +0000 |
commit | fb6341d326846fbbe669ad5173e520f66b339621 (patch) | |
tree | bcc580080b85f58ca751fae121e99bcef148ac64 /include | |
parent | 31e1d6f896615342d5d5b6bde8f7b50b3fd698dc (diff) | |
download | libyuv-fb6341d326846fbbe669ad5173e520f66b339621.tar.gz |
Change ScalePlane,ScalePlane_16,... to return int
Change ScalePlane(), ScalePlane_16(), and ScalePlane_12() to return int
so that they can report memory allocation failures (by returning 1).
BUG=libyuv:968
Change-Id: Ie5c183ee42e3d595302671f9ecb7b3472dc8fdb5
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/5005031
Commit-Queue: Wan-Teh Chang <wtc@google.com>
Reviewed-by: Frank Barchard <fbarchard@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/libyuv/scale.h | 55 | ||||
-rw-r--r-- | include/libyuv/version.h | 2 |
2 files changed, 29 insertions, 28 deletions
diff --git a/include/libyuv/scale.h b/include/libyuv/scale.h index 443f89c2..bfe4a344 100644 --- a/include/libyuv/scale.h +++ b/include/libyuv/scale.h @@ -27,39 +27,40 @@ typedef enum FilterMode { } FilterModeEnum; // Scale a YUV plane. +// Returns 0 if successful. LIBYUV_API -void ScalePlane(const uint8_t* src, - int src_stride, - int src_width, - int src_height, - uint8_t* dst, - int dst_stride, - int dst_width, - int dst_height, - enum FilterMode filtering); +int ScalePlane(const uint8_t* src, + int src_stride, + int src_width, + int src_height, + uint8_t* dst, + int dst_stride, + int dst_width, + int dst_height, + enum FilterMode filtering); LIBYUV_API -void ScalePlane_16(const uint16_t* src, - int src_stride, - int src_width, - int src_height, - uint16_t* dst, - int dst_stride, - int dst_width, - int dst_height, - enum FilterMode filtering); +int ScalePlane_16(const uint16_t* src, + int src_stride, + int src_width, + int src_height, + uint16_t* dst, + int dst_stride, + int dst_width, + int dst_height, + enum FilterMode filtering); // Sample is expected to be in the low 12 bits. LIBYUV_API -void ScalePlane_12(const uint16_t* src, - int src_stride, - int src_width, - int src_height, - uint16_t* dst, - int dst_stride, - int dst_width, - int dst_height, - enum FilterMode filtering); +int ScalePlane_12(const uint16_t* src, + int src_stride, + int src_width, + int src_height, + uint16_t* dst, + int dst_stride, + int dst_width, + int dst_height, + enum FilterMode filtering); // Scales a YUV 4:2:0 image from the src width and height to the // dst width and height. diff --git a/include/libyuv/version.h b/include/libyuv/version.h index 569cb49b..bcea000d 100644 --- a/include/libyuv/version.h +++ b/include/libyuv/version.h @@ -11,6 +11,6 @@ #ifndef INCLUDE_LIBYUV_VERSION_H_ #define INCLUDE_LIBYUV_VERSION_H_ -#define LIBYUV_VERSION 1879 +#define LIBYUV_VERSION 1880 #endif // INCLUDE_LIBYUV_VERSION_H_ |