flacparse: Make sure we have enough data to read image tags

Thanks to iputinei for reporting this on IRC.
This commit is contained in:
Sebastian Dröge 2013-09-12 15:07:48 +02:00
parent 9f9ba21404
commit b95ddd55cd

View 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 ();