free(n[4].data);
n += InstSize[n[0].opcode];
break;
+ case OPCODE_PIXEL_MAP:
+ free(n[3].data);
+ break;
case OPCODE_CONTINUE:
n = (Node *) n[1].next;
return NULL;
}
+
+/** Return copy of memory */
+static void *
+memdup(const void *src, GLsizei bytes)
+{
+ void *b = bytes >= 0 ? malloc(bytes) : NULL;
+ if (b)
+ memcpy(b, src, bytes);
+ return b;
+}
+
+
/**
* Allocate space for a display list instruction (opcode + payload space).
* \param opcode the instruction opcode (OPCODE_* value)
if (n) {
n[1].e = map;
n[2].i = mapsize;
- n[3].data = malloc(mapsize * sizeof(GLfloat));
- memcpy(n[3].data, (void *) values, mapsize * sizeof(GLfloat));
+ n[3].data = memdup(values, mapsize * sizeof(GLfloat));
}
if (ctx->ExecuteFlag) {
CALL_PixelMapfv(ctx->Exec, (map, mapsize, values));
}
-/** Return copy of memory */
-static void *
-memdup(const void *src, GLsizei bytes)
-{
- void *b = bytes >= 0 ? malloc(bytes) : NULL;
- if (b)
- memcpy(b, src, bytes);
- return b;
-}
-
-
static void GLAPIENTRY
save_Uniform1fvARB(GLint location, GLsizei count, const GLfloat *v)
{