diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2018-11-14 04:09:21 +0300 |
---|---|---|
committer | Janne Grunau <janne-vlc@jannau.net> | 2018-11-14 16:27:33 +0300 |
commit | 0bf59f09b246f6266001ef57e5628282a9ea3920 (patch) | |
tree | eed9841034cf7c6c8f4def3e9f44f1d14b130cd7 | |
parent | cf9ec49ac7d0c766ea88ea801c0831bca3e663a9 (diff) |
Fix segmentation map size check
Fixes #166.
-rw-r--r-- | src/decode.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/decode.c b/src/decode.c index 2394a12..ca8ea63 100644 --- a/src/decode.c +++ b/src/decode.c @@ -3093,8 +3093,8 @@ int dav1d_submit_frame(Dav1dContext *const c) { if (f->frame_hdr.segmentation.temporal || !f->frame_hdr.segmentation.update_map) { const int pri_ref = f->frame_hdr.primary_ref_frame; assert(pri_ref != PRIMARY_REF_NONE); - const int ref_w = (f->refp[pri_ref].p.p.w + 3) >> 2; - const int ref_h = (f->refp[pri_ref].p.p.h + 3) >> 2; + const int ref_w = ((f->refp[pri_ref].p.p.w + 7) >> 3) << 1; + const int ref_h = ((f->refp[pri_ref].p.p.h + 7) >> 3) << 1; if (ref_w == f->bw && ref_h == f->bh) { f->prev_segmap_ref = c->refs[f->frame_hdr.refidx[pri_ref]].segmap; if (f->prev_segmap_ref == NULL) { |