Commit 67bab2ba authored by Janne Grunau's avatar Janne Grunau Committed by Jean-Baptiste Kempf

tools/dav1d: unref input data after decoding loop

When breaking out of the decoding either through an error or reaching
the limit of decoded frames the input buffer might not be fully consumed
by the previous dav1d_decode() call. Fixes a memory leak discovered
while testing with frame and tile threads with --limit.
parent 13389e68
......@@ -132,6 +132,8 @@ int main(const int argc, char *const *const argv) {
break;
} while (data.sz > 0 || !input_read(in, &data));
if (data.sz > 0) dav1d_data_unref(&data);
// flush
if (res == 0) while (!cli_settings.limit || n_out < cli_settings.limit) {
if ((res = dav1d_decode(c, NULL, &p)) < 0) {
......
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