[Bf-blender-cvs] [c59ef89] multi_previews_id: Ensure given frame index is valid in drawing icon code.

Bastien Montagne noreply at git.blender.org
Mon Nov 14 17:06:14 CET 2016


Commit: c59ef89456346fc4834bbdf56359e978156abf67
Author: Bastien Montagne
Date:   Mon Nov 14 15:50:50 2016 +0100
Branches: multi_previews_id
https://developer.blender.org/rBc59ef89456346fc4834bbdf56359e978156abf67

Ensure given frame index is valid in drawing icon code.

===================================================================

M	source/blender/editors/interface/interface_icons.c

===================================================================

diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c
index 20ceb09..90efd62 100644
--- a/source/blender/editors/interface/interface_icons.c
+++ b/source/blender/editors/interface/interface_icons.c
@@ -1368,7 +1368,7 @@ static void icon_draw_size(
 			/* preview images use premul alpha ... */
 			glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
 
-			if (frame_idx > 0) {
+			if (frame_idx > 0 && frame_idx < pi->num_frames) {
 				unsigned int *rect = BKE_previewimg_frame_data_get(pi, frame_idx, size, NULL);
 				icon_draw_rect(x, y, w, h, aspect, pi->w[size], pi->h[size], rect, alpha, rgb, is_preview);
 			}




More information about the Bf-blender-cvs mailing list