Subversion Repositories tpanel

Rev

Rev 289 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 289 Rev 363
Line 43... Line 43...
43
    DECL_TRACER("TBitmap::TBitmap(const unsigned char* data, int width, int height, int pixsize)");
43
    DECL_TRACER("TBitmap::TBitmap(const unsigned char* data, int width, int height, int pixsize)");
44
 
44
 
45
    if (!data || width <= 0 || height <= 0 || pixsize < 1)
45
    if (!data || width <= 0 || height <= 0 || pixsize < 1)
46
        return;
46
        return;
47
 
47
 
48
    mSize = (width * pixsize) * height;
48
    mSize = ((size_t)width * (size_t)pixsize) * (size_t)height;
49
    mData = new unsigned char[mSize];
49
    mData = new unsigned char[mSize];
50
    memmove(mData, data, mSize);
50
    memmove(mData, data, mSize);
51
    mPixelSize = pixsize;
51
    mPixelSize = pixsize;
52
    mPixline = width * pixsize;
52
    mPixline = width * pixsize;
53
    mWidth = width;
53
    mWidth = width;
Line 124... Line 124...
124
    clear();
124
    clear();
125
 
125
 
126
    if (!data || width <= 0 || height <= 0 || pixsize < 1)
126
    if (!data || width <= 0 || height <= 0 || pixsize < 1)
127
        return;
127
        return;
128
 
128
 
129
    mSize = (width * pixsize) * height;
129
    mSize = ((size_t)width * (size_t)pixsize) * (size_t)height;
130
    mData = new unsigned char[mSize];
130
    mData = new unsigned char[mSize];
131
    memmove(mData, data, mSize);
131
    memmove(mData, data, mSize);
132
    mPixelSize = pixsize;
132
    mPixelSize = pixsize;
133
    mPixline = width * pixsize;
133
    mPixline = width * pixsize;
134
    mWidth = width;
134
    mWidth = width;