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