shithub: dav1d

Download patch

ref: dab08ce4c55bb29f7d373b75d85d478d0c10aabb
parent: d06e0d6d9d0393db7d4da1304b048f29e9724eff
author: Ronald S. Bultje <rsbultje@gmail.com>
date: Sun Nov 11 05:11:55 EST 2018

Use negative return value in case of segmentation setup errors

--- a/src/decode.c
+++ b/src/decode.c
@@ -3052,7 +3052,10 @@
             const int ref_h = (f->refp[pri_ref].p.p.h + 3) >> 2;
             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) goto error;
+                if (f->prev_segmap_ref == NULL) {
+                    res = -EINVAL;
+                    goto error;
+                }
                 dav1d_ref_inc(f->prev_segmap_ref);
                 f->prev_segmap = f->prev_segmap_ref->data;
             } else {
@@ -3071,6 +3074,7 @@
             dav1d_ref_inc(f->cur_segmap_ref);
             f->cur_segmap = f->prev_segmap_ref->data;
         } else {
+            res = -EINVAL;
             goto error;
         }
     } else {