shithub: dav1d

Download patch

ref: 887c026966d2d781d0b296291c12b06839ede2ce
parent: 5186abdba5cbdec208ced5fe51d47ed307287e33
author: Luc Trudeau <[email protected]>
date: Tue Oct 23 05:41:24 EDT 2018

Fix negative shift exponent in get_poc_diff

As indicated in the spec, get_poc_diff should return 0 when
order_hints are disabled.

Closes #77

--- a/src/env.h
+++ b/src/env.h
@@ -293,6 +293,7 @@
 static inline int get_poc_diff(const int order_hint_n_bits,
                                const int poc0, const int poc1)
 {
+    if (!order_hint_n_bits) return 0;
     const int mask = 1 << (order_hint_n_bits - 1);
     const int diff = poc0 - poc1;
     return (diff & (mask - 1)) - (diff & mask);