Skip to content

Commit

Permalink
gpulib: fix frameskip on weird lists
Browse files Browse the repository at this point in the history
  • Loading branch information
notaz committed Mar 22, 2024
1 parent 1f6c92b commit 8295d33
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions plugins/gpulib/gpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,10 @@ static noinline int do_cmd_list_skip(uint32_t *data, int count, int *last_cmd)
uint32_t *list = data + pos;
cmd = LE32TOH(list[0]) >> 24;
len = 1 + cmd_lengths[cmd];
if (pos + len > count) {
cmd = -1;
break; // incomplete cmd
}

switch (cmd) {
case 0x02:
Expand Down Expand Up @@ -571,11 +575,6 @@ static noinline int do_cmd_list_skip(uint32_t *data, int count, int *last_cmd)
gpu.ex_regs[cmd & 7] = LE32TOH(list[0]);
break;
}

if (pos + len > count) {
cmd = -1;
break; // incomplete cmd
}
if (0x80 <= cmd && cmd <= 0xdf)
break; // image i/o

Expand Down

0 comments on commit 8295d33

Please sign in to comment.