After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 707972 - flacparse will crash on tryin to play this sample
flacparse will crash on tryin to play this sample
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
0.10.x
Other Linux
: Normal normal
: 1.0.11
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-09-12 13:16 UTC by Putinei Ionut
Modified: 2013-09-12 20:35 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Putinei Ionut 2013-09-12 13:16:21 UTC
flacparse will crash on tryin to play this sample.


This is a patch with my fix to solve this problem:

--- gstflacparse_old-560623c83a7f6568d4d22bbdca1549acdb534435.c	2013-09-03 19:31:56.000000000 +0300
+++ gstflacparse_new-4e34574086c47ee52fde7637df9c6db16f9c8ce8.c	2013-09-10 10:58:20.000000000 +0300
@@ -890,6 +890,7 @@
 {
   GstByteReader reader = GST_BYTE_READER_INIT_FROM_BUFFER (buffer);
   const guint8 *data = GST_BUFFER_DATA (buffer);
+  guint32 buffersize = GST_BUFFER_SIZE(buffer);
   guint32 img_len = 0, img_type = 0;
   guint32 img_mimetype_len = 0, img_description_len = 0;
 
@@ -918,8 +919,11 @@
   if (!flacparse->tags)
     flacparse->tags = gst_tag_list_new ();
 
+  if((gst_byte_reader_get_pos (&reader) + img_len) <= buffersize)
+  {
   gst_tag_list_add_id3_image (flacparse->tags,
       data + gst_byte_reader_get_pos (&reader), img_len, img_type);
+  }
 
   if (gst_tag_list_is_empty (flacparse->tags)) {
     gst_tag_list_free (flacparse->tags);
@@ -1465,3 +1469,4 @@
 
   return res;
 }
Comment 1 Putinei Ionut 2013-09-12 13:33:42 UTC
provided sample in link
https://www.dropbox.com/s/ccrim0laq1ha8e9/frame_valid_16mb.flac
Comment 2 Sebastian Dröge (slomo) 2013-09-12 20:35:30 UTC
I fixed that earlier already after you reported it on IRC:
commit b95ddd55cd27f8d25ec3bb9fb6f16c8bb57cd480
Author: Sebastian Dröge <slomo@circular-chaos.org>
Date:   Thu Sep 12 15:07:48 2013 +0200

    flacparse: Make sure we have enough data to read image tags
    
    Thanks to iputinei for reporting this on IRC.



Fix will be in 1.0.11 and 1.1.5.