shithub: dav1d

Download patch

ref: 65d963d4cd1a2bc2f6990b78137b603cd1326c73
parent: 35b1cde28a153b54e3534b8bae75319197dca2f2
author: Martin Storsjö <[email protected]>
date: Thu Feb 7 09:18:03 EST 2019

obu: Initialize off_before_idx[0], fix MSVC warning about uninitialized use

MSVC warns that off_before_idx[0] can be unsed uninitialized
in the line "off_before_idx[1] = off_before_idx[0];" further below.

--- a/src/obu.c
+++ b/src/obu.c
@@ -918,6 +918,7 @@
         unsigned off_before[2] = { 0xFFFFFFFF, 0xFFFFFFFF };
         int off_after = -1;
         int off_before_idx[2], off_after_idx;
+        off_before_idx[0] = 0;
         for (int i = 0; i < 7; i++) {
             if (!c->refs[hdr->refidx[i]].p.p.data[0]) return -EINVAL;
             const unsigned refpoc = c->refs[hdr->refidx[i]].p.p.frame_hdr->frame_offset;