pub struct ParametersChannelMap { /* private fields */ }Expand description
Payload for DemuxError::ParametersChannelMap.
A channel layout declared AV_CHANNEL_ORDER_CUSTOM without the map
that order requires.
This one is a crash, not a curiosity. For a custom order,
av_channel_layout_copy — which is how
avcodec_parameters_to_context moves a layout into a decoder’s
context — does
dst->u.map = av_malloc_array(src->nb_channels, sizeof(*dst->u.map));
if (!dst->u.map)
return AVERROR(ENOMEM);
memcpy(dst->u.map, src->u.map, src->nb_channels * sizeof(*src->u.map));with no null check on src->u.map — verified against FFmpeg
n9.0. A layout that names channels it has no map for therefore makes
libavcodec memcpy from a null pointer the moment a decoder opens
from it.
So the mirror refuses such a layout at the door rather than
reproducing it. An earlier draft carried it through, on the argument
that a malformed layout in should be a malformed layout out — the
round trip is faithful either way, and the parity comparator agreed.
That symmetry was the wrong test: faithfully reproducing a shape
whose only consumer dereferences null is not fidelity, it is
forwarding a crash. Refusing is the same fail-closed answer
extras::measure_parameters gives a channel order it has never
heard of.
Implementations§
Source§impl ParametersChannelMap
impl ParametersChannelMap
Trait Implementations§
Source§impl Clone for ParametersChannelMap
impl Clone for ParametersChannelMap
Source§impl Debug for ParametersChannelMap
impl Debug for ParametersChannelMap
Source§impl Display for ParametersChannelMap
impl Display for ParametersChannelMap
Source§impl Error for ParametersChannelMap
impl Error for ParametersChannelMap
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()