ffplay: avoid signed overflow of the list shuffle seed

Volunteer for testing welcome

Fixes: Qc9DRRq5X1KU
Fixes: signed integer overflow
Signed integer overflow Replicated through Modified FFmpeg with UBSAN
Found during the review of https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24589
This commit is contained in:
Michael Niedermayer authored and michaelni committed 2026-10-20 20:41:50 +00:00
1 parent ad0f34ca30
commit d98487b687
1 file changed
+1 -1
+1 -1
View File
@@ -183,7 +183,7 @@ static void list_sort_by(ListView *lv, int key, int seed_step)
while (lv->sort[i].key != key)
i++;
if (key == LIST_SORT_SHUFFLE)
lv->shuffle_seed += seed_step;
lv->shuffle_seed = (unsigned)lv->shuffle_seed + seed_step;
else if (i == 0)
lv->sort[0].descending ^= 1;
if (i == 0)