GIFTranslator: don't call an implicit constructor for Memblock
This commit is contained in:
@@ -412,6 +412,8 @@ GIFLoad::ReadGIFImageData()
|
|||||||
goto bad_end;
|
goto bad_end;
|
||||||
}
|
}
|
||||||
fTable[fNextCode] = MemblockAllocate(fOldCodeLength + 1);
|
fTable[fNextCode] = MemblockAllocate(fOldCodeLength + 1);
|
||||||
|
if (fTable[fNextCode] == NULL)
|
||||||
|
goto bad_end;
|
||||||
|
|
||||||
//memcpy(fTable[fNextCode], newEntry, fOldCodeLength + 1);
|
//memcpy(fTable[fNextCode], newEntry, fOldCodeLength + 1);
|
||||||
for (unsigned int x = 0; x < fOldCodeLength + 1; x++)
|
for (unsigned int x = 0; x < fOldCodeLength + 1; x++)
|
||||||
@@ -491,8 +493,10 @@ GIFLoad::ResetTable()
|
|||||||
fTable[x] = NULL;
|
fTable[x] = NULL;
|
||||||
if (x < (1 << fCodeSize)) {
|
if (x < (1 << fCodeSize)) {
|
||||||
fTable[x] = MemblockAllocate(1);
|
fTable[x] = MemblockAllocate(1);
|
||||||
fTable[x][0] = x;
|
if (fTable[x] != NULL) {
|
||||||
fEntrySize[x] = 1;
|
fTable[x][0] = x;
|
||||||
|
fEntrySize[x] = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -536,7 +540,10 @@ GIFLoad::MemblockAllocate(int size)
|
|||||||
// them when a new request comes along.
|
// them when a new request comes along.
|
||||||
|
|
||||||
if (fHeadMemblock == NULL) {
|
if (fHeadMemblock == NULL) {
|
||||||
fHeadMemblock = new Memblock();
|
fHeadMemblock = (Memblock*)malloc(sizeof(Memblock));
|
||||||
|
if (fHeadMemblock == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
uchar* value = fHeadMemblock->data;
|
uchar* value = fHeadMemblock->data;
|
||||||
fHeadMemblock->offset = size;
|
fHeadMemblock->offset = size;
|
||||||
fHeadMemblock->next = NULL;
|
fHeadMemblock->next = NULL;
|
||||||
@@ -556,7 +563,10 @@ GIFLoad::MemblockAllocate(int size)
|
|||||||
block = block->next;
|
block = block->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
block = new Memblock();
|
block = (Memblock*)malloc(sizeof(Memblock));
|
||||||
|
if (block == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
uchar* value = block->data;
|
uchar* value = block->data;
|
||||||
block->offset = size;
|
block->offset = size;
|
||||||
block->next = NULL;
|
block->next = NULL;
|
||||||
|
|||||||
@@ -27,11 +27,11 @@
|
|||||||
#define GIF_LOCALCOLORMAP 0x80
|
#define GIF_LOCALCOLORMAP 0x80
|
||||||
|
|
||||||
|
|
||||||
struct Memblock {
|
typedef struct Memblock {
|
||||||
uchar data[4096];
|
unsigned char data[4096];
|
||||||
int offset;
|
int offset;
|
||||||
Memblock* next;
|
Memblock* next;
|
||||||
};
|
} Memblock;
|
||||||
|
|
||||||
|
|
||||||
const int gl_pass_starts_at[] = { 0, 4, 2, 1, 0 };
|
const int gl_pass_starts_at[] = { 0, 4, 2, 1, 0 };
|
||||||
|
|||||||
Reference in New Issue
Block a user