File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -69,15 +69,19 @@ extern "C" fn ccxr_dtvcc_init<'a>(opts_ptr: *const ccx_decoder_dtvcc_settings) -
69
69
/// - dtvcc_rust.decoders[i].tv
70
70
#[ no_mangle]
71
71
extern "C" fn ccxr_dtvcc_free ( dtvcc_rust : * mut Dtvcc ) {
72
- let dtvcc = unsafe { dtvcc_rust. read ( ) } ;
72
+ let dtvcc = unsafe { & mut * dtvcc_rust } ;
73
73
74
74
// closely follows `dtvcc_free` at `src/lib_ccx/ccx_dtvcc.c:126`
75
75
for i in 0 ..decoder:: CCX_DTVCC_MAX_SERVICES {
76
76
if utils:: is_false ( dtvcc. services_active [ i] ) {
77
77
continue ;
78
78
}
79
79
80
- let decoder = & mut dtvcc. decoders [ i] . to_owned ( ) . unwrap ( ) ;
80
+ if dtvcc. decoders [ i] . is_none ( ) {
81
+ continue ;
82
+ }
83
+
84
+ let decoder = & mut dtvcc. decoders [ i] . as_mut ( ) . unwrap ( ) ;
81
85
82
86
decoder. windows . iter_mut ( ) . for_each ( |window| {
83
87
if utils:: is_false ( window. memory_reserved ) {
You can’t perform that action at this time.
0 commit comments