diff options
author | David Schleef <ds@schleef.org> | 2005-03-26 01:24:38 +0000 |
---|---|---|
committer | David Schleef <ds@schleef.org> | 2005-03-26 01:24:38 +0000 |
commit | a587eb0e3849a4937889cb14bdd14f677ad66c59 (patch) | |
tree | e9cbc444d30eef087d0d84833825a67ae6ea59ed /gst/librfb/gstrfbsrc.c | |
parent | 808f0f53fe27fc32b5a40f34f635b1d9c6047ac8 (diff) | |
download | gst-plugins-bad-a587eb0e3849a4937889cb14bdd14f677ad66c59.tar.gz gst-plugins-bad-a587eb0e3849a4937889cb14bdd14f677ad66c59.tar.bz2 gst-plugins-bad-a587eb0e3849a4937889cb14bdd14f677ad66c59.zip |
gst/librfb/gstrfbsrc.c: Check return values to avoid segfaults.
Original commit message from CVS:
* gst/librfb/gstrfbsrc.c: (gst_rfbsrc_get): Check return values
to avoid segfaults.
* gst/librfb/rfbbytestream.c: (rfb_bytestream_get),
(rfb_bytestream_check), (rfb_bytestream_copy_nocheck),
(rfb_bytestream_read), (rfb_bytestream_peek):
* gst/librfb/rfbbytestream.h:
* gst/librfb/rfbdecoder.c: (rfb_socket_get_buffer),
(rfb_socket_send_buffer), (rfb_decoder_iterate),
(rfb_decoder_state_wait_for_protocol_version),
(rfb_decoder_state_wait_for_security),
(rfb_decoder_state_wait_for_server_initialisation),
(rfb_decoder_state_normal), (rfb_decoder_state_framebuffer_update):
Diffstat (limited to 'gst/librfb/gstrfbsrc.c')
-rw-r--r-- | gst/librfb/gstrfbsrc.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/gst/librfb/gstrfbsrc.c b/gst/librfb/gstrfbsrc.c index 99e3144c..80ea761a 100644 --- a/gst/librfb/gstrfbsrc.c +++ b/gst/librfb/gstrfbsrc.c @@ -443,6 +443,7 @@ gst_rfbsrc_get (GstPad * pad) gulong newsize; GstBuffer *buf; RfbDecoder *decoder; + int ret; GST_DEBUG ("gst_rfbsrc_get"); @@ -454,7 +455,10 @@ gst_rfbsrc_get (GstPad * pad) if (!decoder->inited) { while (!decoder->inited) { - rfb_decoder_iterate (decoder); + ret = rfb_decoder_iterate (decoder); + if (!ret) { + /* error */ + } } gst_pad_renegotiate (rfbsrc->srcpad); @@ -476,7 +480,10 @@ gst_rfbsrc_get (GstPad * pad) rfbsrc->go = TRUE; while (rfbsrc->go) { - rfb_decoder_iterate (decoder); + ret = rfb_decoder_iterate (decoder); + if (!ret) { + return GST_DATA (gst_event_new (GST_EVENT_EOS)); + } GST_DEBUG ("iterate...\n"); } |