diff options
author | Wan-Teh Chang <wtc@google.com> | 2022-03-25 07:50:17 -0700 |
---|---|---|
committer | libyuv LUCI CQ <libyuv-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-03-25 15:14:38 +0000 |
commit | 173ed374c05edbfbcf2a54b1a1e2a80d0bb73069 (patch) | |
tree | f606ab936e2f1e000e939e5c7f6d9125e64bb6ef /source/convert_argb.cc | |
parent | a1a52d5364fbb463254ec1fd0cb345dbcd52ff88 (diff) | |
download | libyuv-173ed374c05edbfbcf2a54b1a1e2a80d0bb73069.tar.gz |
Add null pointer checks for the src_a parameters
Change-Id: Icc96e18eab07080c18b6542171a340c97f059c78
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/3550016
Reviewed-by: Mirko Bonadei <mbonadei@chromium.org>
Commit-Queue: Mirko Bonadei <mbonadei@chromium.org>
Diffstat (limited to 'source/convert_argb.cc')
-rw-r--r-- | source/convert_argb.cc | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/source/convert_argb.cc b/source/convert_argb.cc index 97174947..beebe9b4 100644 --- a/source/convert_argb.cc +++ b/source/convert_argb.cc @@ -1823,7 +1823,8 @@ int I420AlphaToARGBMatrix(const uint8_t* src_y, int width) = I422AlphaToARGBRow_C; void (*ARGBAttenuateRow)(const uint8_t* src_argb, uint8_t* dst_argb, int width) = ARGBAttenuateRow_C; - if (!src_y || !src_u || !src_v || !dst_argb || width <= 0 || height == 0) { + if (!src_y || !src_u || !src_v || !src_a || !dst_argb || width <= 0 || + height == 0) { return -1; } // Negative height means invert the image. @@ -1946,7 +1947,8 @@ int I422AlphaToARGBMatrix(const uint8_t* src_y, int width) = I422AlphaToARGBRow_C; void (*ARGBAttenuateRow)(const uint8_t* src_argb, uint8_t* dst_argb, int width) = ARGBAttenuateRow_C; - if (!src_y || !src_u || !src_v || !dst_argb || width <= 0 || height == 0) { + if (!src_y || !src_u || !src_v || !src_a || !dst_argb || width <= 0 || + height == 0) { return -1; } // Negative height means invert the image. @@ -2067,7 +2069,8 @@ int I444AlphaToARGBMatrix(const uint8_t* src_y, int width) = I444AlphaToARGBRow_C; void (*ARGBAttenuateRow)(const uint8_t* src_argb, uint8_t* dst_argb, int width) = ARGBAttenuateRow_C; - if (!src_y || !src_u || !src_v || !dst_argb || width <= 0 || height == 0) { + if (!src_y || !src_u || !src_v || !src_a || !dst_argb || width <= 0 || + height == 0) { return -1; } // Negative height means invert the image. @@ -2309,7 +2312,8 @@ int I010AlphaToARGBMatrix(const uint16_t* src_y, int width) = I210AlphaToARGBRow_C; void (*ARGBAttenuateRow)(const uint8_t* src_argb, uint8_t* dst_argb, int width) = ARGBAttenuateRow_C; - if (!src_y || !src_u || !src_v || !dst_argb || width <= 0 || height == 0) { + if (!src_y || !src_u || !src_v || !src_a || !dst_argb || width <= 0 || + height == 0) { return -1; } // Negative height means invert the image. @@ -2408,7 +2412,8 @@ int I210AlphaToARGBMatrix(const uint16_t* src_y, int width) = I210AlphaToARGBRow_C; void (*ARGBAttenuateRow)(const uint8_t* src_argb, uint8_t* dst_argb, int width) = ARGBAttenuateRow_C; - if (!src_y || !src_u || !src_v || !dst_argb || width <= 0 || height == 0) { + if (!src_y || !src_u || !src_v || !src_a || !dst_argb || width <= 0 || + height == 0) { return -1; } // Negative height means invert the image. @@ -2505,7 +2510,8 @@ int I410AlphaToARGBMatrix(const uint16_t* src_y, int width) = I410AlphaToARGBRow_C; void (*ARGBAttenuateRow)(const uint8_t* src_argb, uint8_t* dst_argb, int width) = ARGBAttenuateRow_C; - if (!src_y || !src_u || !src_v || !dst_argb || width <= 0 || height == 0) { + if (!src_y || !src_u || !src_v || !src_a || !dst_argb || width <= 0 || + height == 0) { return -1; } // Negative height means invert the image. @@ -6003,7 +6009,8 @@ static int I420AlphaToARGBMatrixBilinear( void (*Scale2RowUp)(const uint8_t* src_ptr, ptrdiff_t src_stride, uint8_t* dst_ptr, ptrdiff_t dst_stride, int dst_width) = ScaleRowUp2_Bilinear_Any_C; - if (!src_y || !src_u || !src_v || !dst_argb || width <= 0 || height == 0) { + if (!src_y || !src_u || !src_v || !src_a || !dst_argb || width <= 0 || + height == 0) { return -1; } // Negative height means invert the image. @@ -6188,7 +6195,8 @@ static int I422AlphaToARGBMatrixLinear(const uint8_t* src_y, int width) = ARGBAttenuateRow_C; void (*ScaleRowUp)(const uint8_t* src_ptr, uint8_t* dst_ptr, int dst_width) = ScaleRowUp2_Linear_Any_C; - if (!src_y || !src_u || !src_v || !dst_argb || width <= 0 || height == 0) { + if (!src_y || !src_u || !src_v || !src_a || !dst_argb || width <= 0 || + height == 0) { return -1; } // Negative height means invert the image. @@ -6341,7 +6349,8 @@ static int I010AlphaToARGBMatrixBilinear( void (*Scale2RowUp)(const uint16_t* src_ptr, ptrdiff_t src_stride, uint16_t* dst_ptr, ptrdiff_t dst_stride, int dst_width) = ScaleRowUp2_Bilinear_16_Any_C; - if (!src_y || !src_u || !src_v || !dst_argb || width <= 0 || height == 0) { + if (!src_y || !src_u || !src_v || !src_a || !dst_argb || width <= 0 || + height == 0) { return -1; } // Negative height means invert the image. @@ -6493,7 +6502,8 @@ static int I210AlphaToARGBMatrixLinear(const uint16_t* src_y, int width) = ARGBAttenuateRow_C; void (*ScaleRowUp)(const uint16_t* src_ptr, uint16_t* dst_ptr, int dst_width) = ScaleRowUp2_Linear_16_Any_C; - if (!src_y || !src_u || !src_v || !dst_argb || width <= 0 || height == 0) { + if (!src_y || !src_u || !src_v || !src_a || !dst_argb || width <= 0 || + height == 0) { return -1; } // Negative height means invert the image. |