GNOME Bugzilla – Bug 707972
flacparse will crash on tryin to play this sample
Last modified: 2013-09-12 20:35:30 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; }
provided sample in link https://www.dropbox.com/s/ccrim0laq1ha8e9/frame_valid_16mb.flac
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.