From 4646ee2aaa52205f85c30778046080f29642a6a4 Mon Sep 17 00:00:00 2001 From: Jiri Hnidek Date: Thu, 4 May 2006 11:55:29 +0000 Subject: [PATCH] Bugfix for sequencer: When you wanted to display "Chroma VectorScope" or "Luma WaveForm" for image/window with small width/height, then Blender crashed, because Blender has used fixed limits of ibuf->rect size. Statistics informations should be created corectly now too. --- source/blender/src/seqscopes.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/source/blender/src/seqscopes.c b/source/blender/src/seqscopes.c index a44a5261782..1fa01a6145e 100644 --- a/source/blender/src/seqscopes.c +++ b/source/blender/src/seqscopes.c @@ -87,10 +87,10 @@ static struct ImBuf *make_waveform_view_from_ibuf_byte(struct ImBuf * ibuf) waveform_gamma)*255); } - for (y = 0; y < h; y++) { + for (y = 0; y < ibuf->y; y++) { unsigned char * last_p = 0; - for (x = 0; x < w; x++) { + for (x = 0; x < ibuf->x; x++) { unsigned char * rgb = src + 4 * (ibuf->x * y + x); float v = 1.0 * ( 0.299*rgb[0] @@ -147,10 +147,10 @@ static struct ImBuf *make_waveform_view_from_ibuf_float(struct ImBuf * ibuf) waveform_gamma)*255); } - for (y = 0; y < h; y++) { + for (y = 0; y < ibuf->y; y++) { unsigned char * last_p = 0; - for (x = 0; x < w; x++) { + for (x = 0; x < ibuf->x; x++) { float * rgb = src + 4 * (ibuf->x * y + x); float v = 1.0 * ( 0.299*rgb[0] @@ -259,8 +259,8 @@ static struct ImBuf *make_vectorscope_view_from_ibuf_byte(struct ImBuf * ibuf) vectorscope_put_cross(x, 0, 255, tgt, w, h, 1); } - for (y = 0; y < h; y++) { - for (x = 0; x < w; x++) { + for (y = 0; y < ibuf->y; y++) { + for (x = 0; x < ibuf->x; x++) { char * src1 = src + 4 * (ibuf->x * y + x); char * p; @@ -271,7 +271,7 @@ static struct ImBuf *make_vectorscope_view_from_ibuf_byte(struct ImBuf * ibuf) p = tgt + 4 * (w * (int) ((yuv[2] * (h - 3) + 1)) + (int) ((yuv[1] * (w - 3) + 1))); - scope_put_pixel(wtable, p); + scope_put_pixel(wtable, (unsigned char*)p); } } @@ -306,8 +306,8 @@ static struct ImBuf *make_vectorscope_view_from_ibuf_float(struct ImBuf * ibuf) vectorscope_put_cross(x, 0, 255, tgt, w, h, 1); } - for (y = 0; y < h; y++) { - for (x = 0; x < w; x++) { + for (y = 0; y < ibuf->y; y++) { + for (x = 0; x < ibuf->x; x++) { float * src1 = src + 4 * (ibuf->x * y + x); char * p; @@ -321,7 +321,7 @@ static struct ImBuf *make_vectorscope_view_from_ibuf_float(struct ImBuf * ibuf) p = tgt + 4 * (w * (int) ((yuv[2] * (h - 3) + 1)) + (int) ((yuv[1] * (w - 3) + 1))); - scope_put_pixel(wtable, p); + scope_put_pixel(wtable, (unsigned char*)p); } }