diff options
author | Frank Barchard <fbarchard@google.com> | 2021-09-22 11:18:12 -0700 |
---|---|---|
committer | libyuv LUCI CQ <libyuv-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2021-09-22 19:44:06 +0000 |
commit | b92a60320f6d3021bafe95d7906ad156cb32d611 (patch) | |
tree | 777c850ef90cc1a33f48151a05d07cc970b4df99 | |
parent | 33a68ec7794d6ca897e129d74e425a75a009e156 (diff) | |
download | libyuv-b92a60320f6d3021bafe95d7906ad156cb32d611.tar.gz |
ConvertFromI420 respect destination stride for NV12 and NV21
Bug: libyuv:904
Change-Id: Ie1fd39c693e64661eb52f75492a261384db70776
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/3176483
Reviewed-by: Frank Barchard <fbarchard@chromium.org>
Reviewed-by: richard winterton <rrwinterton@gmail.com>
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
-rw-r--r-- | README.chromium | 2 | ||||
-rw-r--r-- | include/libyuv/version.h | 2 | ||||
-rw-r--r-- | source/convert_from.cc | 6 |
3 files changed, 6 insertions, 4 deletions
diff --git a/README.chromium b/README.chromium index 42c319ce..abdc184a 100644 --- a/README.chromium +++ b/README.chromium @@ -1,6 +1,6 @@ Name: libyuv URL: http://code.google.com/p/libyuv/ -Version: 1790 +Version: 1791 License: BSD License File: LICENSE diff --git a/include/libyuv/version.h b/include/libyuv/version.h index 2b9693a5..9ab8f1ee 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 1790 +#define LIBYUV_VERSION 1791 #endif // INCLUDE_LIBYUV_VERSION_H_ diff --git a/source/convert_from.cc b/source/convert_from.cc index 687f0a72..62a13d04 100644 --- a/source/convert_from.cc +++ b/source/convert_from.cc @@ -772,7 +772,8 @@ int ConvertFromI420(const uint8_t* y, height); break; case FOURCC_NV12: { - uint8_t* dst_uv = dst_sample + width * height; + int dst_y_stride = dst_sample_stride ? dst_sample_stride : width; + uint8_t* dst_uv = dst_sample + dst_y_stride * height; r = I420ToNV12(y, y_stride, u, u_stride, v, v_stride, dst_sample, dst_sample_stride ? dst_sample_stride : width, dst_uv, dst_sample_stride ? dst_sample_stride : width, width, @@ -780,7 +781,8 @@ int ConvertFromI420(const uint8_t* y, break; } case FOURCC_NV21: { - uint8_t* dst_vu = dst_sample + width * height; + int dst_y_stride = dst_sample_stride ? dst_sample_stride : width; + uint8_t* dst_vu = dst_sample + dst_y_stride * height; r = I420ToNV21(y, y_stride, u, u_stride, v, v_stride, dst_sample, dst_sample_stride ? dst_sample_stride : width, dst_vu, dst_sample_stride ? dst_sample_stride : width, width, |