X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fas3%2Fpool.c;h=ec089a09c480fc352f16e95f270e02c8d410055b;hb=d9028caacb25b27d07c6b642556e8d372bb267a1;hp=a74ddb2907448cc5c302248605425bafdbd0fb6b;hpb=36a1fac8ea3a7457f25b1b4209b5fc918cc6af44;p=swftools.git diff --git a/lib/as3/pool.c b/lib/as3/pool.c index a74ddb2..ec089a0 100644 --- a/lib/as3/pool.c +++ b/lib/as3/pool.c @@ -657,7 +657,7 @@ constant_t* constant_new_float(double f) c->type = CONSTANT_FLOAT; return c; } -constant_t* constant_new_string(char*s) +constant_t* constant_new_string(const char*s) { NEW(constant_t,c); c->s = string_new4(s); @@ -800,6 +800,10 @@ int constant_get_index(pool_t*pool, constant_t*c) return pool_register_float(pool, c->f); } else if(c->type == CONSTANT_STRING) { return pool_register_string2(pool, c->s); + } else if(c->type == CONSTANT_UNDEFINED) { + /* write undefined with index 0 (and no type). Otherwise, the FlashPlayer + seems to throw an "attempt to read out of bounds" exception */ + return 0; } else if(!constant_has_index(c)) { return 1; } else {