mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-10-28 10:04:37 +08:00
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:
1 parent
ad0f34ca30
commit
d98487b687
1 file changed
+1
-1
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user