[gst-cvs] gst-plugins-good: jpegdec: Prevent crash when reading image with problems

Thiago Sousa Santos thiagoss at kemper.freedesktop.org
Fri Aug 20 11:35:04 PDT 2010


Module: gst-plugins-good
Branch: master
Commit: 95d1b932abaf02f42c7a1539fbcc963b5f0b60b8
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=95d1b932abaf02f42c7a1539fbcc963b5f0b60b8

Author: Thiago Santos <thiago.sousa.santos at collabora.co.uk>
Date:   Thu Aug 19 18:30:05 2010 -0300

jpegdec: Prevent crash when reading image with problems

Check if we have data on the adapter and fail if not.

Fixes #627413

---

 ext/jpeg/gstjpegdec.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/ext/jpeg/gstjpegdec.c b/ext/jpeg/gstjpegdec.c
index 0e90819..333658e 100644
--- a/ext/jpeg/gstjpegdec.c
+++ b/ext/jpeg/gstjpegdec.c
@@ -211,6 +211,11 @@ gst_jpeg_dec_fill_input_buffer (j_decompress_ptr cinfo)
   GST_DEBUG_OBJECT (dec, "fill_input_buffer: fast av=%u, remaining=%u", av,
       dec->rem_img_len);
 
+  if (av == 0) {
+    GST_DEBUG_OBJECT (dec, "Out of data");
+    return FALSE;
+  }
+
   if (dec->rem_img_len < av)
     av = dec->rem_img_len;
   dec->rem_img_len -= av;





More information about the Gstreamer-commits mailing list