35 lines
1.1 KiB
Diff
35 lines
1.1 KiB
Diff
|
From 06ff2ce680ede4b727ca9fee0050e146736ec032 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 404c577d6..c38b00aaf 100644
|
||
|
--- a/vpx/src/vpx_image.c
|
||
|
+++ b/vpx/src/vpx_image.c
|
||
|
@@ -79,8 +79,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
|
||
|
|