--- gst-plugins-bad-1.1.2/sys/uvch264/gstuvch264_mjpgdemux.c	2013-04-23 08:38:28.000000000 -0400
+++ gst-plugins-bad-1.1.2.new/sys/uvch264/gstuvch264_mjpgdemux.c	2013-07-28 08:50:08.476491800 -0400
@@ -487,6 +487,7 @@
   gst_buffer_map (buf, &info, GST_MAP_READ);
 
   data = info.data;
+  size = info.size;
 
   for (i = 0; i < size - 1; i++) {
     /* Check for APP4 (0xe4) marker in the jpeg */
@@ -711,6 +712,8 @@
   if (jpeg_buf)
     gst_buffer_unref (jpeg_buf);
 
+  gst_buffer_unmap(buf, &info);
+
   /* We must always unref the input buffer since we never push it out */
   gst_buffer_unref (buf);
 
