ref: dd576607133683eb5a1008349d9d5f62693cceb6
parent: 65b41008e4fbe9b10f116c03569651e896709811
author: James Almer <jamrial@gmail.com>
date: Fri Sep 28 13:38:08 EDT 2018
Check for valid input in dav1d_data_unref
--- a/src/data.c
+++ b/src/data.c
@@ -65,6 +65,11 @@
}
void dav1d_data_unref(Dav1dData *const buf) {
- dav1d_ref_dec(buf->ref);
+ validate_input(buf != NULL);
+
+ if (buf->ref) {
+ validate_input(buf->data != NULL);
+ dav1d_ref_dec(buf->ref);
+ }
memset(buf, 0, sizeof(*buf));
}