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