From 615f6e55c16eed41b266b24c377d9e0f99009bed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Wed, 7 May 2014 00:58:15 +0100 Subject: [PATCH] flacparse: skip PICTURE headers without any image data Fixes warning if the image length is 0. --- gst/audioparsers/gstflacparse.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gst/audioparsers/gstflacparse.c b/gst/audioparsers/gstflacparse.c index cb7a39ec25..d36693b474 100644 --- a/gst/audioparsers/gstflacparse.c +++ b/gst/audioparsers/gstflacparse.c @@ -1136,8 +1136,11 @@ gst_flac_parse_handle_picture (GstFlacParse * flacparse, GstBuffer * buffer) flacparse->tags = gst_tag_list_new_empty (); GST_INFO_OBJECT (flacparse, "Got image of %d bytes", img_len); - gst_tag_list_add_id3_image (flacparse->tags, - map.data + gst_byte_reader_get_pos (&reader), img_len, img_type); + + if (img_len > 0) { + gst_tag_list_add_id3_image (flacparse->tags, + map.data + gst_byte_reader_get_pos (&reader), img_len, img_type); + } if (gst_tag_list_is_empty (flacparse->tags)) { gst_tag_list_unref (flacparse->tags);