35 lines
1.1 KiB
Diff
35 lines
1.1 KiB
Diff
|
From f8472f581ed1b4dd0d205efdec72e43742f579fb Mon Sep 17 00:00:00 2001
|
||
|
From: Wan-Teh Chang <wtc@google.com>
|
||
|
Date: Thu, 11 Apr 2024 16:38:45 -0700
|
||
|
Subject: [PATCH 2/3] Apply stride_align to byte count, not pixel count
|
||
|
|
||
|
A port of the libaom CL
|
||
|
https://aomedia-review.googlesource.com/c/aom/+/188962.
|
||
|
|
||
|
stride_align is documented to be the "alignment, in bytes, of each row
|
||
|
in the image (stride)."
|
||
|
|
||
|
Change-Id: I2184b50dc3607611f47719319fa5adb3adcef2fd
|
||
|
(cherry picked from commit 7d37ffacc6f7c45554b48ca867be4223248f1ed6)
|
||
|
---
|
||
|
vpx/src/vpx_image.c | 2 +-
|
||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||
|
|
||
|
diff --git a/vpx/src/vpx_image.c b/vpx/src/vpx_image.c
|
||
|
index a01aab29c..0c84562ae 100644
|
||
|
--- a/vpx/src/vpx_image.c
|
||
|
+++ b/vpx/src/vpx_image.c
|
||
|
@@ -93,8 +93,8 @@ static vpx_image_t *img_alloc_helper(vpx_image_t *img, vpx_img_fmt_t fmt,
|
||
|
w = d_w;
|
||
|
h = d_h;
|
||
|
s = (fmt & VPX_IMG_FMT_PLANAR) ? w : (uint64_t)bps * w / 8;
|
||
|
- s = (s + stride_align - 1) & ~((uint64_t)stride_align - 1);
|
||
|
s = (fmt & VPX_IMG_FMT_HIGHBITDEPTH) ? s * 2 : s;
|
||
|
+ s = (s + stride_align - 1) & ~((uint64_t)stride_align - 1);
|
||
|
if (s > INT_MAX) goto fail;
|
||
|
stride_in_bytes = (int)s;
|
||
|
|
||
|
--
|
||
|
2.45.2
|
||
|
|