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 @@ -82,15 +82,19 @@ extern "C" fn ccxr_dtvcc_init<'a>(opts_ptr: *const ccx_decoder_dtvcc_settings) -
82
82
/// - dtvcc_rust.decoders[i].tv
83
83
#[ no_mangle]
84
84
extern "C" fn ccxr_dtvcc_free ( dtvcc_rust : * mut Dtvcc ) {
85
- let dtvcc = unsafe { dtvcc_rust. read ( ) } ;
85
+ let dtvcc = unsafe { & mut * dtvcc_rust } ;
86
86
87
87
// closely follows `dtvcc_free` at `src/lib_ccx/ccx_dtvcc.c:126`
88
88
for i in 0 ..decoder:: CCX_DTVCC_MAX_SERVICES {
89
89
if utils:: is_false ( dtvcc. services_active [ i] ) {
90
90
continue ;
91
91
}
92
92
93
- let decoder = & mut dtvcc. decoders [ i] . to_owned ( ) . unwrap ( ) ;
93
+ if dtvcc. decoders [ i] . is_none ( ) {
94
+ continue ;
95
+ }
96
+
97
+ let decoder = & mut dtvcc. decoders [ i] . as_mut ( ) . unwrap ( ) ;
94
98
95
99
decoder. windows . iter_mut ( ) . for_each ( |window| {
96
100
if utils:: is_false ( window. memory_reserved ) {
You can’t perform that action at this time.
0 commit comments