+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),
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;
}
}
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");
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;
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;
}
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;