GIFTranslator: don't call an implicit constructor for Memblock

This commit is contained in:
John Scipione
2014-03-04 01:22:49 -05:00
parent 116e78d4d4
commit 071f3a6ea0
2 changed files with 19 additions and 9 deletions
+14 -4
View File
@@ -412,6 +412,8 @@ GIFLoad::ReadGIFImageData()
goto bad_end;
}
fTable[fNextCode] = MemblockAllocate(fOldCodeLength + 1);
if (fTable[fNextCode] == NULL)
goto bad_end;
//memcpy(fTable[fNextCode], newEntry, fOldCodeLength + 1);
for (unsigned int x = 0; x < fOldCodeLength + 1; x++)
@@ -491,8 +493,10 @@ GIFLoad::ResetTable()
fTable[x] = NULL;
if (x < (1 << fCodeSize)) {
fTable[x] = MemblockAllocate(1);
fTable[x][0] = x;
fEntrySize[x] = 1;
if (fTable[x] != NULL) {
fTable[x][0] = x;
fEntrySize[x] = 1;
}
}
}
}
@@ -536,7 +540,10 @@ GIFLoad::MemblockAllocate(int size)
// them when a new request comes along.
if (fHeadMemblock == NULL) {
fHeadMemblock = new Memblock();
fHeadMemblock = (Memblock*)malloc(sizeof(Memblock));
if (fHeadMemblock == NULL)
return NULL;
uchar* value = fHeadMemblock->data;
fHeadMemblock->offset = size;
fHeadMemblock->next = NULL;
@@ -556,7 +563,10 @@ GIFLoad::MemblockAllocate(int size)
block = block->next;
}
block = new Memblock();
block = (Memblock*)malloc(sizeof(Memblock));
if (block == NULL)
return NULL;
uchar* value = block->data;
block->offset = size;
block->next = NULL;
+5 -5
View File
@@ -27,11 +27,11 @@
#define GIF_LOCALCOLORMAP 0x80
struct Memblock {
uchar data[4096];
int offset;
Memblock* next;
};
typedef struct Memblock {
unsigned char data[4096];
int offset;
Memblock* next;
} Memblock;
const int gl_pass_starts_at[] = { 0, 4, 2, 1, 0 };