aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2025-06-04 20:06:01 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2025-06-17 00:33:09 +0200
commita4b3474de6d4df02b6473d335d74a46a0952bfd6 (patch)
tree69f5c5b57880bc5225400ee036cdeda2e1a6e92d
parent48427b012daf37653e8111f82812cb91a7f66362 (diff)
downloadffmpeg-a4b3474de6d4df02b6473d335d74a46a0952bfd6.tar.gz
avfilter/vf_overlay: Keep dst_step in bytes
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-rw-r--r--libavfilter/vf_overlay.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/libavfilter/vf_overlay.c b/libavfilter/vf_overlay.c
index cd92c7323b..17fe8e47c9 100644
--- a/libavfilter/vf_overlay.c
+++ b/libavfilter/vf_overlay.c
@@ -474,9 +474,7 @@ static av_always_inline void blend_plane_##depth##_##nbits##bits(AVFilterContext
int slice_start, slice_end; \
const T max = (1 << nbits) - 1; \
const T mid = (1 << (nbits - 1)); \
- int bytes = depth / 8; \
\
- dst_step /= bytes; \
j = FFMAX(-yp, 0); \
jmax = FFMIN3(-yp + dst_hp, FFMIN(src_hp, dst_hp), yp + src_hp); \
\
@@ -495,7 +493,7 @@ static av_always_inline void blend_plane_##depth##_##nbits##bits(AVFilterContext
const T *s = (const T *)sp + k; \
const T *a = (const T *)ap + (k << hsub); \
const T *da = main_has_alpha ? (T *)dap + ((xp + k) << hsub) : NULL; \
- T *d = (T *)dp + (xp + k) * dst_step; \
+ T *d = (T *)(dp + (xp + k) * dst_step); \
kmax = FFMIN(-xp + dst_wp, src_wp); \
\
if (nbits == 8 && ((vsub && j+1 < src_hp) || !vsub) && octx->blend_row[i]) { \
@@ -503,7 +501,7 @@ static av_always_inline void blend_plane_##depth##_##nbits##bits(AVFilterContext
(uint8_t*)a, kmax - k, src->linesize[3]); \
\
s += c; \
- d += dst_step * c; \
+ d = PTR_ADD(T, d, dst_step * c); \
if (main_has_alpha) \
da += (1 << hsub) * c; \
a += (1 << hsub) * c; \
@@ -564,7 +562,7 @@ static av_always_inline void blend_plane_##depth##_##nbits##bits(AVFilterContext
} \
} \
s++; \
- d += dst_step; \
+ d = PTR_ADD(T, d, dst_step); \
if (main_has_alpha) \
da += 1 << hsub; \
a += 1 << hsub; \