[vlc-commits] Fix texture cache accesses in opengl

Laurent Aimar git at videolan.org
Tue Sep 13 22:59:27 CEST 2011


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Tue Sep 13 22:37:42 2011 +0200| [b1b6d346b5cafa545515d37d6f722946a1dc87cf] | committer: Laurent Aimar

Fix texture cache accesses in opengl

It fixes a potential out of bound access.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b1b6d346b5cafa545515d37d6f722946a1dc87cf
---

 modules/video_output/opengl.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/modules/video_output/opengl.c b/modules/video_output/opengl.c
index 236b0d2..bc18a4a 100644
--- a/modules/video_output/opengl.c
+++ b/modules/video_output/opengl.c
@@ -628,13 +628,13 @@ int vout_display_opengl_Prepare(vout_display_opengl_t *vgl,
 
             glr->texture = 0;
             for (int j = 0; j < last_count; j++) {
-                if (last[i].texture &&
-                    last[i].width  == glr->width &&
-                    last[i].height == glr->height &&
-                    last[i].format == glr->format &&
-                    last[i].type   == glr->type) {
-                    glr->texture = last[i].texture;
-                    memset(&last[i], 0, sizeof(last[i]));
+                if (last[j].texture &&
+                    last[j].width  == glr->width &&
+                    last[j].height == glr->height &&
+                    last[j].format == glr->format &&
+                    last[j].type   == glr->type) {
+                    glr->texture = last[j].texture;
+                    memset(&last[j], 0, sizeof(last[j]));
                     break;
                 }
             }



More information about the vlc-commits mailing list