mirror of
https://code.videolan.org/videolan/dav1d
synced 2026-06-11 04:03:05 +00:00
Fix wrong assignment if stride or sbh change, but stride * sbh don't
Credit to oss-fuzz.
This commit is contained in:
+3
-1
@@ -3060,7 +3060,8 @@ int dav1d_decode_frame_init(Dav1dFrameContext *const f) {
|
||||
const int need_cdef_lpf_copy = c->n_tc > 1 && has_resize;
|
||||
if (y_stride * f->sbh * 4 != f->lf.cdef_buf_plane_sz[0] ||
|
||||
uv_stride * f->sbh * 8 != f->lf.cdef_buf_plane_sz[1] ||
|
||||
need_cdef_lpf_copy != f->lf.need_cdef_lpf_copy)
|
||||
need_cdef_lpf_copy != f->lf.need_cdef_lpf_copy ||
|
||||
f->sbh != f->lf.cdef_buf_sbh)
|
||||
{
|
||||
dav1d_free_aligned(f->lf.cdef_line_buf);
|
||||
size_t alloc_sz = 64;
|
||||
@@ -3112,6 +3113,7 @@ int dav1d_decode_frame_init(Dav1dFrameContext *const f) {
|
||||
f->lf.cdef_buf_plane_sz[0] = (int) y_stride * f->sbh * 4;
|
||||
f->lf.cdef_buf_plane_sz[1] = (int) uv_stride * f->sbh * 8;
|
||||
f->lf.need_cdef_lpf_copy = need_cdef_lpf_copy;
|
||||
f->lf.cdef_buf_sbh = f->sbh;
|
||||
}
|
||||
|
||||
const int sb128 = f->seq_hdr->sb128;
|
||||
|
||||
@@ -275,6 +275,7 @@ struct Dav1dFrameContext {
|
||||
Av1Restoration *lr_mask;
|
||||
int mask_sz /* w*h */, lr_mask_sz;
|
||||
int cdef_buf_plane_sz[2]; /* stride*sbh*4 */
|
||||
int cdef_buf_sbh;
|
||||
int lr_buf_plane_sz[2]; /* (stride*sbh*4) << sb128 if n_tc > 1, else stride*4 */
|
||||
int re_sz /* h */;
|
||||
ALIGN(Av1FilterLUT lim_lut, 16);
|
||||
|
||||
Reference in New Issue
Block a user