diff options
author | Vincent Penquerc'h <vincent.penquerch@collabora.co.uk> | 2014-04-17 09:35:37 +0100 |
---|---|---|
committer | Vincent Penquerc'h <vincent.penquerch@collabora.co.uk> | 2014-04-21 09:24:00 +0100 |
commit | 52981d5a4a2a6dd0e666a00fcf873d70ccc4b319 (patch) | |
tree | 0d90166afe2e936b5b63ea27429e94c242d2f902 /gst | |
parent | 9815faea9b8aaedc8b8d87383c2957064271e87a (diff) | |
download | gstreamer-plugins-bad-52981d5a4a2a6dd0e666a00fcf873d70ccc4b319.tar.gz |
mxfdemux: guard against NULL non source components
This component is dereferenced, and later code checking for
NULL in particular cases implies it can be NULL. This likely
does not fix the coverity warning as it was seeing another
path setting component to NULL explicitely, but this was
spotted by looking at:
Coverity 1139736
Which is actually OK from what I can see since the actual
dereference of the explicit NULL pointer will not happen
if the condition that led to the NULL pointer assignment
is met, since the assignment and defeference have mutually
exclusive tests.
Diffstat (limited to 'gst')
-rw-r--r-- | gst/mxf/mxfdemux.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gst/mxf/mxfdemux.c b/gst/mxf/mxfdemux.c index 838665e31..c2ee74148 100644 --- a/gst/mxf/mxfdemux.c +++ b/gst/mxf/mxfdemux.c @@ -1009,6 +1009,15 @@ gst_mxf_demux_update_tracks (GstMXFDemux * demux) component = MXF_METADATA_SOURCE_CLIP (sequence->structural_components [component_index]); + if (!component) { + GST_WARNING_OBJECT (demux, "NULL conponent in non source package"); + if (!pad) { + continue; + } else { + ret = GST_FLOW_ERROR; + goto error; + } + } if (component->source_package && component->source_package->top_level && MXF_METADATA_GENERIC_PACKAGE (component->source_package)->tracks) { |