X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=avi2swf%2Fvideoreader_vfw.cc;h=b40c378b5f287081f2eff54d468618707fb372e7;hb=dd3ba1d40caa1e4083b91be451b2cd79675a15a3;hp=124284a50dc3f3162014b63c683d36188ef00e60;hpb=96b5b5dcc9e45af1782b0b9509691238a4f12cc3;p=swftools.git 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