aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2024-05-14 23:17:30 -0300
committerJames Almer <jamrial@gmail.com>2024-05-14 23:17:30 -0300
commit8670615743eb36d7b3e9b522266518796df7ec54 (patch)
tree817435df1b7dc0694315f19ecc3ca4381223a765
parente9741f1a6bc2c3be05e818b1d5d2cb6f6e1d857a (diff)
downloadffmpeg-8670615743eb36d7b3e9b522266518796df7ec54.tar.gz
checkasm/h264dsp: add missing pixel_mask values
Fixes "runtime error: index 4 out of bounds for type 'uint32_t [3]'" errors after commit 4ced36744ee0bea5fb7a20d1b2926c588f89ea0b. Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r--tests/checkasm/h264dsp.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/checkasm/h264dsp.c b/tests/checkasm/h264dsp.c
index 30ac81e71e..cb180cc44f 100644
--- a/tests/checkasm/h264dsp.c
+++ b/tests/checkasm/h264dsp.c
@@ -27,17 +27,17 @@
#include "libavutil/intreadwrite.h"
#include "libavutil/mem_internal.h"
-static const uint32_t pixel_mask[3] = { 0xffffffff, 0x01ff01ff, 0x03ff03ff };
+static const uint32_t pixel_mask[5] = { 0xffffffff, 0x01ff01ff, 0x03ff03ff, 0x0fff0fff, 0x3fff3fff };
static const uint32_t pixel_mask_lf[3] = { 0xff0fff0f, 0x01ff000f, 0x03ff000f };
#define SIZEOF_PIXEL ((bit_depth + 7) / 8)
#define SIZEOF_COEF (2 * ((bit_depth + 7) / 8))
#define PIXEL_STRIDE 16
-#define randomize_buffers() \
+#define randomize_buffers(idx) \
do { \
int x, y; \
- uint32_t mask = pixel_mask[bit_depth - 8]; \
+ uint32_t mask = pixel_mask[(idx)]; \
for (y = 0; y < sz; y++) { \
for (x = 0; x < PIXEL_STRIDE; x += 4) { \
AV_WN32A(src + y * PIXEL_STRIDE + x, rnd() & mask); \
@@ -189,7 +189,7 @@ static void check_idct(void)
bit_depth = depths[i];
ff_h264dsp_init(&h, bit_depth, 1);
for (sz = 4; sz <= 8; sz += 4) {
- randomize_buffers();
+ randomize_buffers(i);
if (sz == 4)
dct4x4(coef, bit_depth);
@@ -277,7 +277,7 @@ static void check_idct_multiple(void)
int offset = (block_y * 16 + block_x) * SIZEOF_PIXEL;
int nnz = rnd() % 3;
- randomize_buffers();
+ randomize_buffers(bit_depth - 8);
if (sz == 4)
dct4x4(coef, bit_depth);
else