rtph264pay: avoid double buffer unmap on error
authorDavid Svensson Fors <davidsf@axis.com>
Thu, 27 Jun 2013 05:40:29 +0000 (07:40 +0200)
committerWim Taymans <wim.taymans@collabora.co.uk>
Thu, 27 Jun 2013 15:14:11 +0000 (17:14 +0200)
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=703171

gst/rtp/gstrtph264pay.c

index 1929117..79727ba 100644 (file)
@@ -556,10 +556,12 @@ gst_rtp_h264_pay_setcaps (GstRTPBasePayload * basepayload, GstCaps * caps)
       data += nal_size;
       size -= nal_size;
     }
-    gst_buffer_unmap (buffer, &map);
+
     /* and update the caps with the collected data */
     if (!gst_rtp_h264_pay_set_sps_pps (basepayload))
       goto set_sps_pps_failed;
+
+    gst_buffer_unmap (buffer, &map);
   } else {
     GST_DEBUG_OBJECT (rtph264pay, "have bytestream h264");
   }