flacparse: Make sure we have enough data to read image tags
authorSebastian Dröge <slomo@circular-chaos.org>
Thu, 12 Sep 2013 13:07:48 +0000 (15:07 +0200)
committerSebastian Dröge <slomo@circular-chaos.org>
Thu, 12 Sep 2013 13:39:51 +0000 (15:39 +0200)
Thanks to iputinei for reporting this on IRC.

gst/audioparsers/gstflacparse.c

index a5b294a..8756942 100644 (file)
@@ -1129,6 +1129,9 @@ gst_flac_parse_handle_picture (GstFlacParse * flacparse, GstBuffer * buffer)
   if (!gst_byte_reader_get_uint32_be (&reader, &img_len))
     goto error;
 
+  if (gst_byte_reader_get_pos (&reader) + img_len > map.size)
+    goto error;
+
   if (!flacparse->tags)
     flacparse->tags = gst_tag_list_new_empty ();