diff --git a/src/db.c b/src/db.c index d69d2180..00c848ea 100644 --- a/src/db.c +++ b/src/db.c @@ -1644,8 +1644,17 @@ db_pl_fetch_byquery(char *query) } } + ret = sqlite3_step(stmt); sqlite3_finalize(stmt); + if (ret != SQLITE_DONE) + { + DPRINTF(E_WARN, L_DB, "Query had more than a single result!\n"); + + free_pli(pli, 0); + return NULL; + } + /* Playlist 1: all files */ if (pli->id == 1) pli->items = db_files_get_count();