added "scale" attribute to swf_Render_Init().
[swftools.git] / lib / modules / swftools.c
index e3d20ee..94c440f 100644 (file)
@@ -844,17 +844,19 @@ void swf_Relocate (SWF*swf, char*bitmap)
        } 
        
        num = swf_GetNumUsedIDs(tag);
-       ptr = rfx_alloc(sizeof(int)*num);
-       swf_GetUsedIDs(tag, ptr);
-
-       for(t=0;t<num;t++) {
-           int id = GET16(&tag->data[ptr[t]]);
-           if(slaveids[id]<0) {
-               fprintf(stderr, "swf_Relocate: Mapping id never encountered before: %d\n", id);
-               return ;
+       if(num) {
+           ptr = rfx_alloc(sizeof(int)*num);
+           swf_GetUsedIDs(tag, ptr);
+
+           for(t=0;t<num;t++) {
+               int id = GET16(&tag->data[ptr[t]]);
+               if(slaveids[id]<0) {
+                   fprintf(stderr, "swf_Relocate: Mapping id never encountered before: %d\n", id);
+                   return ;
+               }
+               id = slaveids[id];
+               PUT16(&tag->data[ptr[t]], id);
            }
-           id = slaveids[id];
-           PUT16(&tag->data[ptr[t]], id);
        }
        tag=tag->next;
     }