From f0e59e782020a315c3b110a2ae2ecec07acc0e57 Mon Sep 17 00:00:00 2001 From: Matt Ranostay Date: Mon, 13 Nov 2017 13:18:33 -0800 Subject: binding: mediaplayer: add tag size check Slight chance to have an infinite tag check for album art data, and this patchset avoids that possibility by checking the max index of tags. Bug-AGL: SPEC-1091 Change-Id: I63836ea6e9795c97cfd0c07231c556bbbb8d9528 Signed-off-by: Matt Ranostay --- binding/afm-mediaplayer-binding.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'binding') diff --git a/binding/afm-mediaplayer-binding.c b/binding/afm-mediaplayer-binding.c index ed532a8..9c41f27 100644 --- a/binding/afm-mediaplayer-binding.c +++ b/binding/afm-mediaplayer-binding.c @@ -423,9 +423,10 @@ static void controls(struct afb_req request) static gchar *get_album_art(GstTagList *tags) { GstSample *sample = NULL; + int num = gst_tag_list_get_tag_size(tags, GST_TAG_IMAGE); guint i; - for (i = 0; ; i++) { + for (i = 0; i < num ; i++) { const GValue *value; GstStructure *caps; int type; -- cgit 1.2.3-korg