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>
This commit is contained in:
Wan-Teh Chang 2022-03-25 07:50:17 -07:00 committed by libyuv LUCI CQ
parent a1a52d5364
commit 173ed374c0

View File

@ -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.