Skip to content

Commit

Permalink
video/out/gpu/video: prevent OOB access when larger angles are used
Browse files Browse the repository at this point in the history
  • Loading branch information
na-na-hi authored and kasper93 committed Nov 11, 2024
1 parent d66ed2d commit 70b202a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion video/out/gpu/video.c
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ static int pass_bind(struct gl_video *p, struct image img)
static void get_transform(float w, float h, int rotate, bool flip,
struct gl_transform *out_tr)
{
int a = rotate % 90 ? 0 : rotate / 90;
int a = rotate % 90 ? 0 : (rotate / 90) % 4;
int sin90[4] = {0, 1, 0, -1}; // just to avoid rounding issues etc.
int cos90[4] = {1, 0, -1, 0};
struct gl_transform tr = {{{ cos90[a], sin90[a]},
Expand Down

0 comments on commit 70b202a

Please sign in to comment.