[gstreamer-bugs] [Bug 635397] New: rfbsrc: avoid infinite loop if source gets disconnected and don't crash if frame geometry changes

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Sat Nov 20 16:18:45 PST 2010


https://bugzilla.gnome.org/show_bug.cgi?id=635397
  GStreamer | gst-plugins-bad | git

           Summary: rfbsrc: avoid infinite loop if source gets
                    disconnected and  don't crash if frame geometry
                    changes
    Classification: Desktop
           Product: GStreamer
           Version: git
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: gst-plugins-bad
        AssignedTo: gstreamer-bugs at lists.sourceforge.net
        ReportedBy: t.i.m at zen.co.uk
         QAContact: gstreamer-bugs at lists.sourceforge.net
      GNOME target: ---
     GNOME version: ---


Created an attachment (id=174935)
 View: https://bugzilla.gnome.org/attachment.cgi?id=174935
 Review: https://bugzilla.gnome.org/review?bug=635397&attachment=174935

rfbsrc patch

<mife> 12:51:47> I don't need another bugzilla account so never posted there,
but http://airattack-central.com/gst-librfbpatch.patch is a patch I've got
working so that librfbsrc (vnc source) doesn't get caught in an infinite loop
if the source gets disconnected and also supports gracefully failing upon
detecting the frame geometry has increased (rather than segfaulting). This was
done so I could use a gstreamer pipeline to record VM sessions from libvirt - I
don't think t
--------------

Asked for git format-patch formatted patch.

--------------

<mife> Th patch fixes two bugs. The first is an infinite loop when it reads
from the socket. Although theres sanity checks in the code it appears as though
this doesn't always matter. Which ultimately causes a while loop further up the
code to keep on executing. You can't get out of the loop without terminating
the program externally
<mife> I added a disconnected flag to the rfbdecoder struct and set that to
true when there is a disconnect. The disconnect code does work its just lots of
places in the code doesn't seem to care about what gets returned from that
function.
<mife> I additionally added a check further up the code for the disconnect,
which causes the rfbsrc to die more gracefully.
<mife> Im pretty sure that merely patching it for my scenario as I suspect
therse more places which can catch into the loop
<mife> The second bug I fixed was a geometry one. VMs that utilize VNC
connections often dynamically switch geometries in the remote frame buffer.
<mife> gstreamers plugin can't handle this as it allocates its memory buffer
after determining what the width of its rectangle is going to be when it
initialized. This causes a segfault because the code attempts to write past the
heap it was allocated when the screen size changes.
<__tim> ok
<mife> I basically do a check at the top now to determine if the size of the
rectangle about to be written into the buffer is greater than the size of the
allocated buffer. If true it gracefully errors and disconnects (uses the same
disconnect method I put in place)
<__tim> and what's your name + e-mail please? (so I can dump all this into
bugzilla)
<mife> so, now it doesn segfault but exits gracefully.
<mife> I guess it would actually be better to reallocate the buffer.
<mife> matthew.ife at ukfast.co.uk
<mife> Matthew Ife

-- 
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