Blame SOURCES/0006-geometrictransform-crash-fix2.patch

8b2abe
From 7dd5b2002abf516ebdf92696c57a9a7692c166e9 Mon Sep 17 00:00:00 2001
8b2abe
From: Thiago Santos <thiago.sousa.santos@collabora.com>
8b2abe
Date: Tue, 20 Mar 2012 23:07:11 +0000
8b2abe
Subject: geometrictransform: Prevent access to the transform map when it is null
8b2abe
8b2abe
Check if the map doesn't exist when receiving a new caps and create
8b2abe
a new one. This prevents that the transform functions try to access
8b2abe
the map when it doesn't exist.
8b2abe
8b2abe
diff --git a/gst/geometrictransform/gstgeometrictransform.c b/gst/geometrictransform/gstgeometrictransform.c
8b2abe
index be651a4..a1ec3ab 100644
8b2abe
--- a/gst/geometrictransform/gstgeometrictransform.c
8b2abe
+++ b/gst/geometrictransform/gstgeometrictransform.c
8b2abe
@@ -178,8 +178,8 @@ gst_geometric_transform_set_caps (GstBaseTransform * btrans, GstCaps * incaps,
8b2abe
 
8b2abe
     /* regenerate the map */
8b2abe
     GST_OBJECT_LOCK (gt);
8b2abe
-    if (old_width == 0 || old_height == 0 || gt->width != old_width ||
8b2abe
-        gt->height != old_height) {
8b2abe
+    if (gt->map == NULL || old_width == 0 || old_height == 0
8b2abe
+        || gt->width != old_width || gt->height != old_height) {
8b2abe
       if (klass->prepare_func)
8b2abe
         if (!klass->prepare_func (gt)) {
8b2abe
           GST_OBJECT_UNLOCK (gt);
8b2abe
@@ -352,6 +352,9 @@ gst_geometric_transform_stop (GstBaseTransform * trans)
8b2abe
 {
8b2abe
   GstGeometricTransform *gt = GST_GEOMETRIC_TRANSFORM_CAST (trans);
8b2abe
 
8b2abe
+  gt->width = 0;
8b2abe
+  gt->height = 0;
8b2abe
+
8b2abe
   g_free (gt->map);
8b2abe
   gt->map = NULL;
8b2abe
 
8b2abe
--
8b2abe
cgit v0.9.0.2-2-gbebe