sodium: Handle error from Adapter::copy()

This commit is contained in:
Sebastian Dröge 2020-12-07 11:42:48 +02:00
parent 6aed1ed926
commit 46651e31c4

View file

@ -218,7 +218,10 @@ impl State {
return Err(gst::FlowError::Error); return Err(gst::FlowError::Error);
} }
}; };
self.adapter.copy(0, &mut map[..available_size]); if let Err(_) = self.adapter.copy(0, &mut map[..available_size]) {
gst_error!(CAT, obj: pad, "Failed to copy into provided buffer");
return Err(gst::FlowError::Error);
}
if map.len() != available_size { if map.len() != available_size {
drop(map); drop(map);
buffer.set_size(available_size); buffer.set_size(available_size);