rtp: buffer: don't access NULL buffer pointer
authorBrian Peters <brianfpeters@gmail.com>
Thu, 30 Jul 2015 13:30:44 +0000 (14:30 +0100)
committerTim-Philipp Müller <tim@centricular.com>
Thu, 30 Jul 2015 13:30:44 +0000 (14:30 +0100)
unmap will set rtpbuffer->buffer to NULL, so we need to
save the pointer to access it while the RTP buffer is
unmapped.

https://bugzilla.gnome.org/show_bug.cgi?id=753001

gst-libs/gst/rtp/gstrtpbuffer.c

index fe160ab..51b323e 100644 (file)
@@ -787,8 +787,10 @@ ensure_buffers (GstRTPBuffer * rtp)
   }
 
   if (changed) {
+    GstBuffer *buf = rtp->buffer;
+
     gst_rtp_buffer_unmap (rtp);
-    gst_buffer_remove_memory_range (rtp->buffer, pos, -1);
+    gst_buffer_remove_memory_range (buf, pos, -1);
     gst_rtp_buffer_map (rtp->buffer, GST_MAP_READWRITE, rtp);
   }
 }