Check for valid input in dav1d_data_unref

parent 65b41008
......@@ -65,6 +65,11 @@ int dav1d_data_wrap(Dav1dData *const buf, uint8_t *const ptr, const size_t sz,
}
void dav1d_data_unref(Dav1dData *const buf) {
validate_input(buf != NULL);
if (buf->ref) {
validate_input(buf->data != NULL);
dav1d_ref_dec(buf->ref);
}
memset(buf, 0, sizeof(*buf));
}
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