Diff between c888c682fbd4e02dce6bf4c1f9a47328ceb02716 and bea5cc4d12b48edb58c851c7e9ad9640bb7cedee

Changed Files

File Additions Deletions Status
profiles/audio/avrcp.c +9 -0 modified

Full Patch

diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c
index 8d1e03b..2d7b4e1 100644
--- a/profiles/audio/avrcp.c
+++ b/profiles/audio/avrcp.c
@@ -3879,6 +3879,15 @@ static void avrcp_now_playing_changed(struct avrcp *session,
 
 	DBG("NowPlaying changed");
 
+	/* reset the list_items operation, if it is in progress or else we will
+	 * crash because _clear_playlist() frees the items
+	 */
+	if (player->p) {
+		g_slist_free(player->p->items);
+		g_free(player->p);
+		player->p = NULL;
+	}
+
 	media_player_clear_playlist(mp);
 }