diff options
Diffstat (limited to 'source/convert_from.cc')
-rw-r--r-- | source/convert_from.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/convert_from.cc b/source/convert_from.cc index d331ed2d..932a32b8 100644 --- a/source/convert_from.cc +++ b/source/convert_from.cc @@ -85,7 +85,7 @@ int I420ToI010(const uint8_t* src_y, int height) { int halfwidth = (width + 1) >> 1; int halfheight = (height + 1) >> 1; - if (!src_u || !src_v || !dst_u || !dst_v || width <= 0 || height == 0) { + if ((!src_y && dst_y) || !src_u || !src_v || !dst_u || !dst_v || width <= 0 || height == 0) { return -1; } // Negative height means invert the image. @@ -129,7 +129,7 @@ int I420ToI012(const uint8_t* src_y, int height) { int halfwidth = (width + 1) >> 1; int halfheight = (height + 1) >> 1; - if (!src_u || !src_v || !dst_u || !dst_v || width <= 0 || height == 0) { + if ((!src_y && dst_y) || !src_u || !src_v || !dst_u || !dst_v || width <= 0 || height == 0) { return -1; } // Negative height means invert the image. |