Commit b1b6d346 authored by Laurent Aimar's avatar Laurent Aimar

Fix texture cache accesses in opengl

It fixes a potential out of bound access.
parent a4820b53
...@@ -628,13 +628,13 @@ int vout_display_opengl_Prepare(vout_display_opengl_t *vgl, ...@@ -628,13 +628,13 @@ int vout_display_opengl_Prepare(vout_display_opengl_t *vgl,
glr->texture = 0; glr->texture = 0;
for (int j = 0; j < last_count; j++) { for (int j = 0; j < last_count; j++) {
if (last[i].texture && if (last[j].texture &&
last[i].width == glr->width && last[j].width == glr->width &&
last[i].height == glr->height && last[j].height == glr->height &&
last[i].format == glr->format && last[j].format == glr->format &&
last[i].type == glr->type) { last[j].type == glr->type) {
glr->texture = last[i].texture; glr->texture = last[j].texture;
memset(&last[i], 0, sizeof(last[i])); memset(&last[j], 0, sizeof(last[j]));
break; break;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment