Commit 488374c7 authored by Janne Grunau's avatar Janne Grunau

output_picture: unref pictures on allocation errors

parent 3746b6e1
......@@ -265,8 +265,11 @@ static int output_image(Dav1dContext *const c, Dav1dPicture *const out,
// Apply film grain to a new copy of the image to avoid corrupting refs
int res = dav1d_picture_alloc_copy(out, in->p.w, in);
if (res < 0)
if (res < 0) {
dav1d_picture_unref(in);
dav1d_picture_unref(out);
return res;
}
switch (out->p.bpc) {
#if CONFIG_8BPC
......
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