diff options
author | Henrik Gramner <gramner@twoorioles.com> | 2021-12-03 23:51:14 +0300 |
---|---|---|
committer | Henrik Gramner <henrik@gramner.com> | 2021-12-03 23:51:14 +0300 |
commit | 7b99b0e17fbd86f0847684798b182f9122545580 (patch) | |
tree | f4db30b46e35a32c5c023d23dbcaeb7f041c0502 /src/decode.c | |
parent | 19ff99ea8417b3c9a62ff4c1bd14fffceb26ad73 (diff) |
Fix lr line buffer padding
Some cdef asm functions accesses memory before the start of the buffer.
There are two lr line buffers allocated, but only one of them had the
correct padding applied.
Diffstat (limited to 'src/decode.c')
-rw-r--r-- | src/decode.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/decode.c b/src/decode.c index a0b79ba..c3827f6 100644 --- a/src/decode.c +++ b/src/decode.c @@ -3124,7 +3124,7 @@ int dav1d_decode_frame_init(Dav1dFrameContext *const f) { { dav1d_free_aligned(f->lf.lr_line_buf); // lr simd may overread the input, so slightly over-allocate the lpf buffer - size_t alloc_sz = 64; + size_t alloc_sz = 128; alloc_sz += (size_t)llabs(y_stride) * num_lines; alloc_sz += (size_t)llabs(uv_stride) * num_lines * 2; uint8_t *ptr = f->lf.lr_line_buf = dav1d_alloc_aligned(alloc_sz, 64); @@ -3133,6 +3133,7 @@ int dav1d_decode_frame_init(Dav1dFrameContext *const f) { goto error; } + ptr += 64; if (y_stride < 0) f->lf.lr_lpf_line[0] = ptr - y_stride * (num_lines - 1); else |