shithub: libvpx

Download patch

ref: 9751aa1264b9cff20b729bbe825c6ff25ff47a12
parent: a75551585b0fb1ea8705e7e5c53433cfffabbab6
author: Yaowu Xu <yaowu@google.com>
date: Tue Oct 7 07:22:09 EDT 2014

Add range checking for decoded coefficients.

The coefficient range checking is enabled when configured with
--enable-debug --enable-coefficient-range-checking
for vpxdec to detect ill-formed input stream. This addresses the
problem raised by issue #792.

Change-Id: I3f9ea541de4dc742dd64389d6c5f543fb1c4f052

--- a/vp9/decoder/vp9_detokenize.c
+++ b/vp9/decoder/vp9_detokenize.c
@@ -190,7 +190,11 @@
       }
     }
     v = (val * dqv) >> dq_shift;
+#if CONFIG_COEFFICIENT_RANGE_CHECKING
+    dqcoeff[scan[c]] = check_range(vp9_read_bit(r) ? -v : v);
+#else
     dqcoeff[scan[c]] = vp9_read_bit(r) ? -v : v;
+#endif
     token_cache[scan[c]] = vp9_pt_energy_class[token];
     ++c;
     ctx = get_coef_context(nb, token_cache, c);