Commit b7740617 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont Committed by Jean-Baptiste Kempf

filesystem: avoid potential qsort(NULL)

(cherry picked from commit 558e6b78d4c269a2de4a152cd2c72cb685c65027)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 88efd1e2
......@@ -153,7 +153,7 @@ int vlc_loaddir( DIR *dir, char ***namelist,
num++;
}
if (compar != NULL)
if (compar != NULL && num > 0)
qsort (tab, num, sizeof (*tab),
(int (*)( const void *, const void *))compar);
*namelist = tab;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment