From dd3ba1d40caa1e4083b91be451b2cd79675a15a3 Mon Sep 17 00:00:00 2001 From: kramm Date: Tue, 28 Sep 2004 07:24:56 +0000 Subject: [PATCH] fixed "avi2swf hangs" problem. --- avi2swf/videoreader_vfw.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/avi2swf/videoreader_vfw.cc b/avi2swf/videoreader_vfw.cc index 124284a..b40c378 100644 --- a/avi2swf/videoreader_vfw.cc +++ b/avi2swf/videoreader_vfw.cc @@ -89,14 +89,14 @@ static int bitmap_to_rgba(BITMAPINFOHEADER*bi, void*buffer, const int dest_width int linex = ((bytesperpixel/8)+3)&~3; memset(dest, 255, dest_width*dest_height*4);//pre-fill alpha channel - int starty = flip? 0 : dest_height-1; - int endy = flip? dest_height-1 : 0; - int yinc = flip? 1 : -1; + const int starty = flip? 0 : dest_height-1; + const int endy = flip? dest_height : -1; + const int yinc = flip? 1 : -1; if(bi->biBitCount==1) { UCHAR*img = data; int y; - for(y=starty;y<=endy;y+=yinc) { + for(y=starty;y!=endy;y+=yinc) { UCHAR*line = &img[linex*y]; int x; for(x=0;xbiClrUsed*4]; UCHAR*pal = data; int y; - for(y=starty;y<=endy;y+=yinc) { + for(y=starty;y!=endy;y+=yinc) { UCHAR*line = &img[linex*y]; int x; for(x=0;xbiClrUsed*4]; UCHAR*pal = data; int y; - for(y=starty;y<=endy;y+=yinc) { + for(y=starty;y!=endy;y+=yinc) { UCHAR*line = &img[linex*y]; int x; for(x=0;xbiBitCount==24) { UCHAR*img = data; int y; - for(y=starty;y<=endy;y+=yinc) { + for(y=starty;y!=endy;y+=yinc) { UCHAR*line = &img[linex*y]; int x; for(x=0;xbiBitCount==32) { UCHAR*img = data; int y; - for(y=starty;y<=endy;y+=yinc) { + for(y=starty;y!=endy;y+=yinc) { UCHAR*line = &img[linex*y]; int x; for(x=0;x