commit | 488374c79eed9be44fd5b08fa9b52ec9ecaa21f7 | [log] [tgz] |
---|---|---|
author | Janne Grunau <janne-vlc@jannau.net> | Sat Dec 08 19:09:35 2018 +0100 |
committer | Janne Grunau <janne-vlc@jannau.net> | Sat Dec 08 20:42:28 2018 +0100 |
tree | 634b531b3bf55276557259034e4282a780f2e529 | |
parent | 3746b6e128324fff7468463aeac332279eb5d59c [diff] |
output_picture: unref pictures on allocation errors
diff --git a/src/lib.c b/src/lib.c index d2aed23..1e5ea0b 100644 --- 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