[Bug 738013] v4l2allocator: issue with import_userptr() in single-planar API when n_planes > 1

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Thu Jan 22 16:33:31 PST 2015


https://bugzilla.gnome.org/show_bug.cgi?id=738013
  GStreamer | gst-plugins-good | git master

Nicolas Dufresne (stormer) <nicolas.dufresne> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #294853|none                        |reviewed
             status|                            |

--- Comment #7 from Nicolas Dufresne (stormer) <nicolas.dufresne at collabora.co.uk> 2015-01-23 00:33:29 UTC ---
Review of attachment 294853:
 --> (https://bugzilla.gnome.org/review?bug=738013&attachment=294853)

::: sys/v4l2/gstv4l2allocator.c
@@ +1167,3 @@
+        tmp = ((guint8 *) data[i]) + pix_fmt->bytesperline * pix_fmt->height;
+        if (tmp != data[i + 1])
+          goto non_contiguous_mem;

This logic seems right.

@@ -1164,0 +1180,5 @@
+
+      if ((i + 1) == n_planes) {
+        size = img_size - offset[i];
... 2 more ...

My fault, but this calculation of the plane size cannot be trusted. We'll need
to pass the stride[] array instead of offset. Offset are relative to the
buffer, there is no guaranty substracting offset give you plane size since data
pointer may not be at the start of the memory.

The correct way is to calculate this way:
    size = stride[i] * height

A special case is needed for tiled formats. I think we should fix in a seperate
patch, prior to this one.

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list