Check if the map doesn't exist when receiving a new caps and create
a new one. This prevents that the transform functions try to access
the map when it doesn't exist.
/* regenerate the map */
GST_OBJECT_LOCK (gt);
- if (old_width == 0 || old_height == 0 || gt->width != old_width ||
- gt->height != old_height) {
+ if (gt->map == NULL || old_width == 0 || old_height == 0
+ || gt->width != old_width || gt->height != old_height) {
if (klass->prepare_func)
if (!klass->prepare_func (gt)) {
GST_OBJECT_UNLOCK (gt);
GstGeometricTransform *gt = GST_GEOMETRIC_TRANSFORM_CAST (trans);
GST_INFO_OBJECT (gt, "Deleting transform map");
+
+ gt->width = 0;
+ gt->height = 0;
+
g_free (gt->map);
gt->map = NULL;