ref: 488374c79eed9be44fd5b08fa9b52ec9ecaa21f7
parent: 3746b6e128324fff7468463aeac332279eb5d59c
author: Janne Grunau <janne-vlc@jannau.net>
date: Sat Dec 8 14:09:35 EST 2018
output_picture: unref pictures on allocation errors
--- a/src/lib.c
+++ b/src/lib.c
@@ -265,8 +265,11 @@
// 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