aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/vc1dsp.c
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2022-03-29 15:34:19 +0300
committerMartin Storsjö <martin@martin.st>2022-03-30 14:53:55 +0300
commitdb54426975e124e98e5130ad01316cb7afd60630 (patch)
tree0041dc41a52aabdefa9fc513c0ac0b8fc600f328 /libavcodec/vc1dsp.c
parent3721aaeaaae9f817abb843117ae8dae1dc280a7f (diff)
downloadffmpeg-db54426975e124e98e5130ad01316cb7afd60630.tar.gz
vc1dsp: Change remaining stride parameters to ptrdiff_t
The existing x86 assembly for loop filters uses the stride as a full register without clearing/sign extending the upper half of the registers on x86_64. This avoids crashes if the caller would have passed nonzero bits in the previously undefined upper 32 bits of the parameters. Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavcodec/vc1dsp.c')
-rw-r--r--libavcodec/vc1dsp.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/libavcodec/vc1dsp.c b/libavcodec/vc1dsp.c
index a29b91bf3d..f651d7d461 100644
--- a/libavcodec/vc1dsp.c
+++ b/libavcodec/vc1dsp.c
@@ -36,7 +36,7 @@
#include "startcode.h"
/* Apply overlap transform to horizontal edge */
-static void vc1_v_overlap_c(uint8_t *src, int stride)
+static void vc1_v_overlap_c(uint8_t *src, ptrdiff_t stride)
{
int i;
int a, b, c, d;
@@ -60,7 +60,7 @@ static void vc1_v_overlap_c(uint8_t *src, int stride)
}
/* Apply overlap transform to vertical edge */
-static void vc1_h_overlap_c(uint8_t *src, int stride)
+static void vc1_h_overlap_c(uint8_t *src, ptrdiff_t stride)
{
int i;
int a, b, c, d;
@@ -109,7 +109,7 @@ static void vc1_v_s_overlap_c(int16_t *top, int16_t *bottom)
}
}
-static void vc1_h_s_overlap_c(int16_t *left, int16_t *right, int left_stride, int right_stride, int flags)
+static void vc1_h_s_overlap_c(int16_t *left, int16_t *right, ptrdiff_t left_stride, ptrdiff_t right_stride, int flags)
{
int i;
int a, b, c, d;
@@ -146,7 +146,7 @@ static void vc1_h_s_overlap_c(int16_t *left, int16_t *right, int left_stride, in
* @return whether other 3 pairs should be filtered or not
* @see 8.6
*/
-static av_always_inline int vc1_filter_line(uint8_t *src, int stride, int pq)
+static av_always_inline int vc1_filter_line(uint8_t *src, ptrdiff_t stride, int pq)
{
int a0 = (2 * (src[-2 * stride] - src[1 * stride]) -
5 * (src[-1 * stride] - src[0 * stride]) + 4) >> 3;
@@ -195,7 +195,7 @@ static av_always_inline int vc1_filter_line(uint8_t *src, int stride, int pq)
* @param pq block quantizer
* @see 8.6
*/
-static inline void vc1_loop_filter(uint8_t *src, int step, int stride,
+static inline void vc1_loop_filter(uint8_t *src, int step, ptrdiff_t stride,
int len, int pq)
{
int i;
@@ -212,32 +212,32 @@ static inline void vc1_loop_filter(uint8_t *src, int step, int stride,
}
}
-static void vc1_v_loop_filter4_c(uint8_t *src, int stride, int pq)
+static void vc1_v_loop_filter4_c(uint8_t *src, ptrdiff_t stride, int pq)
{
vc1_loop_filter(src, 1, stride, 4, pq);
}
-static void vc1_h_loop_filter4_c(uint8_t *src, int stride, int pq)
+static void vc1_h_loop_filter4_c(uint8_t *src, ptrdiff_t stride, int pq)
{
vc1_loop_filter(src, stride, 1, 4, pq);
}
-static void vc1_v_loop_filter8_c(uint8_t *src, int stride, int pq)
+static void vc1_v_loop_filter8_c(uint8_t *src, ptrdiff_t stride, int pq)
{
vc1_loop_filter(src, 1, stride, 8, pq);
}
-static void vc1_h_loop_filter8_c(uint8_t *src, int stride, int pq)
+static void vc1_h_loop_filter8_c(uint8_t *src, ptrdiff_t stride, int pq)
{
vc1_loop_filter(src, stride, 1, 8, pq);
}
-static void vc1_v_loop_filter16_c(uint8_t *src, int stride, int pq)
+static void vc1_v_loop_filter16_c(uint8_t *src, ptrdiff_t stride, int pq)
{
vc1_loop_filter(src, 1, stride, 16, pq);
}
-static void vc1_h_loop_filter16_c(uint8_t *src, int stride, int pq)
+static void vc1_h_loop_filter16_c(uint8_t *src, ptrdiff_t stride, int pq)
{
vc1_loop_filter(src, stride, 1, 16, pq);
}