rtpsconnection: Fix number of n_vectors
authorGöran Jönsson <goranjn@axis.com>
Thu, 27 Jun 2019 06:04:07 +0000 (08:04 +0200)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 10 Aug 2019 13:50:40 +0000 (14:50 +0100)
Body_offset mean that so much data have been written.

Without this patch n_vectors somtimes  becomes one more than it should
and then there will be an vector that have a random size causing
writev_bytes to cause a "Bad address" error.

gst-libs/gst/rtsp/gstrtspconnection.c

index 9f63533..942ddba 100644 (file)
@@ -3871,7 +3871,7 @@ gst_rtsp_source_dispatch_write (GPollableOutputStream * stream,
           GstMemory *mem = gst_buffer_peek_memory (msg->body_buffer, m);
 
           /* Skip all memories we already wrote */
-          if (offset + mem->size < msg->body_offset) {
+          if (offset + mem->size <= msg->body_offset) {
             offset += mem->size;
             continue;
           }