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 @@ -97,15 +97,19 @@ extern "C" fn ccxr_dtvcc_init<'a>(opts_ptr: *const ccx_decoder_dtvcc_settings) -
97
97
/// - dtvcc_rust.decoders[i].tv
98
98
#[ no_mangle]
99
99
extern "C" fn ccxr_dtvcc_free ( dtvcc_rust : * mut Dtvcc ) {
100
- let dtvcc = unsafe { dtvcc_rust. read ( ) } ;
100
+ let dtvcc = unsafe { & mut * dtvcc_rust } ;
101
101
102
102
// closely follows `dtvcc_free` at `src/lib_ccx/ccx_dtvcc.c:126`
103
103
for i in 0 ..decoder:: CCX_DTVCC_MAX_SERVICES {
104
104
if utils:: is_false ( dtvcc. services_active [ i] ) {
105
105
continue ;
106
106
}
107
107
108
- let decoder = & mut dtvcc. decoders [ i] . to_owned ( ) . unwrap ( ) ;
108
+ if dtvcc. decoders [ i] . is_none ( ) {
109
+ continue ;
110
+ }
111
+
112
+ let decoder = & mut dtvcc. decoders [ i] . as_mut ( ) . unwrap ( ) ;
109
113
110
114
decoder. windows . iter_mut ( ) . for_each ( |window| {
111
115
if utils:: is_false ( window. memory_reserved ) {
You can’t perform that action at this time.
0 commit comments