Commit a4083095 authored by Janne Grunau's avatar Janne Grunau

obu/film grain: check ref frame frame_hdr before use

Fixes NULL dereference with
clusterfuzz-testcase-minimized-dav1d_fuzzer_mt-5649526686220288. Credits
to oss-fuzz.
parent aee656d7
......@@ -1040,7 +1040,7 @@ static int parse_frame_hdr(Dav1dContext *const c, GetBits *const gb) {
for (i = 0; i < 7; i++)
if (hdr->refidx[i] == refidx)
break;
if (i == 7) goto error;
if (i == 7 || !c->refs[refidx].p.p.frame_hdr) goto error;
hdr->film_grain.data = c->refs[refidx].p.p.frame_hdr->film_grain.data;
hdr->film_grain.data.seed = seed;
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment