mirror of
https://github.com/mpv-player/mpv
synced 2025-03-11 08:37:59 +00:00
vo_opengl: fix some undefined behavior
The gl_timer_last_us() function could access samples[-1]. Fix by coercing to unsigned, so the % will put it into index [0,max). The real value returned in this corner case doesn't mean too much, I guess.
This commit is contained in:
parent
c3248369ac
commit
03933f3564
@ -1061,7 +1061,7 @@ void gl_sc_generate(struct gl_shader_cache *sc)
|
||||
|
||||
// How many samples to keep around, for the sake of average and peak
|
||||
// calculations. This corresponds to a few seconds (exact time variable)
|
||||
#define QUERY_SAMPLE_SIZE 256
|
||||
#define QUERY_SAMPLE_SIZE 256u
|
||||
|
||||
struct gl_timer {
|
||||
GL *gl;
|
||||
|
Loading…
Reference in New Issue
Block a user