diff options
author | Sebastian Dröge <slomo@circular-chaos.org> | 2009-01-05 10:34:03 +0000 |
---|---|---|
committer | Sebastian Dröge <slomo@circular-chaos.org> | 2009-01-05 10:34:03 +0000 |
commit | caa83490672d4acfd8569d876b4f134c5f72afaa (patch) | |
tree | 42f9d996a81e6d53a6cf7fdb93a74f3d6a49dbc1 | |
parent | b5f61341ddbe3d7b011c01e974d658ec503c795f (diff) | |
download | gstreamer-plugins-bad-caa83490672d4acfd8569d876b4f134c5f72afaa.tar.gz |
gst/mxf/mxfdemux.c: Don't allow negative or zero edit rates to prevent division by zero and we support negative edit ...
Original commit message from CVS:
* gst/mxf/mxfdemux.c:
(gst_mxf_demux_handle_header_metadata_update_streams),
(gst_mxf_demux_pad_next_component):
Don't allow negative or zero edit rates to prevent division
by zero and we support negative edit rates anyway.
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | gst/mxf/mxfdemux.c | 29 |
2 files changed, 29 insertions, 8 deletions
@@ -1,3 +1,11 @@ +2009-01-05 Sebastian Dröge <sebastian.droege@collabora.co.uk> + + * gst/mxf/mxfdemux.c: + (gst_mxf_demux_handle_header_metadata_update_streams), + (gst_mxf_demux_pad_next_component): + Don't allow negative or zero edit rates to prevent division + by zero and we support negative edit rates anyway. + 2009-01-05 Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> * ext/x264/gstx264enc.c: (gst_x264_enc_class_init), diff --git a/gst/mxf/mxfdemux.c b/gst/mxf/mxfdemux.c index 6b6683c70..6aa18428e 100644 --- a/gst/mxf/mxfdemux.c +++ b/gst/mxf/mxfdemux.c @@ -560,11 +560,11 @@ gst_mxf_demux_choose_package (GstMXFDemux * demux) for (i = 0; i < demux->preface->content_storage->n_packages; i++) { if (demux->preface->content_storage->packages[i] && - MXF_IS_METADATA_MATERIAL_PACKAGE (demux->preface->content_storage-> - packages[i])) { + MXF_IS_METADATA_MATERIAL_PACKAGE (demux->preface-> + content_storage->packages[i])) { ret = - MXF_METADATA_GENERIC_PACKAGE (demux->preface->content_storage-> - packages[i]); + MXF_METADATA_GENERIC_PACKAGE (demux->preface-> + content_storage->packages[i]); break; } } @@ -701,6 +701,12 @@ gst_mxf_demux_handle_header_metadata_update_streams (GstMXFDemux * demux) continue; } + if (track->edit_rate.n <= 0 || track->edit_rate.d <= 0 || + source_track->edit_rate.n <= 0 || source_track->edit_rate.d <= 0) { + GST_WARNING_OBJECT (demux, "Track has an invalid edit rate"); + continue; + } + if (MXF_IS_METADATA_MATERIAL_PACKAGE (current_package) && !component) { GST_WARNING_OBJECT (demux, "Playing material package but found no component for track"); @@ -968,9 +974,11 @@ gst_mxf_demux_pad_next_component (GstMXFDemux * demux, GstMXFDemuxPad * pad) return GST_FLOW_UNEXPECTED; } + GST_DEBUG_OBJECT (demux, "Switching to component %u", pad->current_component); + pad->component = - MXF_METADATA_SOURCE_CLIP (sequence->structural_components[pad-> - current_component]); + MXF_METADATA_SOURCE_CLIP (sequence-> + structural_components[pad->current_component]); if (pad->component == NULL) { GST_ERROR_OBJECT (demux, "No such structural component"); return GST_FLOW_ERROR; @@ -978,8 +986,8 @@ gst_mxf_demux_pad_next_component (GstMXFDemux * demux, GstMXFDemuxPad * pad) if (!pad->component->source_package || !pad->component->source_package->top_level - || !MXF_METADATA_GENERIC_PACKAGE (pad->component-> - source_package)->tracks) { + || !MXF_METADATA_GENERIC_PACKAGE (pad->component->source_package)-> + tracks) { GST_ERROR_OBJECT (demux, "Invalid component"); return GST_FLOW_ERROR; } @@ -1011,6 +1019,11 @@ gst_mxf_demux_pad_next_component (GstMXFDemux * demux, GstMXFDemuxPad * pad) return GST_FLOW_ERROR; } + if (pad->source_track->edit_rate.n <= 0 || + pad->source_track->edit_rate.d <= 0) { + GST_ERROR_OBJECT (demux, "Source track has invalid edit rate"); + return GST_FLOW_ERROR; + } pad->current_component_position = 0; pad->current_component_drop = pad->source_track->origin; |