v4l2: bufferpool: Do not resize compressed buffer
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Tue, 5 Sep 2023 20:15:19 +0000 (16:15 -0400)
committerTim-Philipp Müller <tim@centricular.com>
Tue, 12 Sep 2023 16:42:06 +0000 (17:42 +0100)
Avoid resizing compressed buffer to their maximum size. This fixes a
regression that caused valid but very large streams to be generated.

Fixes #2953

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5319>

subprojects/gst-plugins-good/sys/v4l2/gstv4l2bufferpool.c

index e8bd01eb2d1e5bfa85fd41a7397f42fcd2264467..68bab75e600a7056f2b8e62b72dd1711b84be2cd 100644 (file)
@@ -1298,6 +1298,9 @@ gst_v4l2_buffer_pool_dqbuf (GstV4l2BufferPool * pool, GstBuffer ** buffer,
         group->planes[i].bytesused, i, group->buffer.flags,
         GST_TIME_ARGS (timestamp), pool->num_queued, outbuf, old_buffer_state);
 
+    if (GST_VIDEO_INFO_FORMAT (&pool->caps_info) == GST_VIDEO_FORMAT_ENCODED)
+      break;
+
     /* Ensure our offset matches the expected plane size, or image size if
      * there is only one memory */
     if (group->n_mem == 1) {