close(fi);
swf->taglist = taglist_new2(swf->swf.firstTag);
+ if(swf->taglist == NULL) {
+ return NULL;
+ }
swf->swf.firstTag = 0;
return (PyObject*)swf;
TAG*tag = swf->firstTag;
if(!tag)
tag = swf->firstTag = swf_InsertTag(0,ST_END);
- while(tag && tag->next)
+ while(tag && tag->next) {
+ mylog(" tag:%08x\n", tag);
tag = tag->next;
+ }
if(tag->id != ST_END) {
tag = swf_InsertTag(tag,ST_END);
}
PyObject* tag_new2(TAG*t, PyObject* tagmap)
{
TagObject*tag = PyObject_New(TagObject, &TagClass);
- mylog("+%08x(%d) tag_new\n", (int)tag, tag->ob_refcnt);
+ mylog("+%08x(%d) tag_new tag=%08x\n", (int)tag, tag->ob_refcnt, t);
tag->font = 0;
tag->character = 0;
tag->placeobject = 0;
/* serialize */
TAG* tag_getTAG(PyObject*self, TAG*prevTag, PyObject*tagmap)
{
- mylog(" %08x(%d) tag_getTAG tagmap=%08x \n", (int)self, self->ob_refcnt, tagmap);
TagObject*tag = (TagObject*)self;
TAG* t = tag_getRAWTAG(self);
+ mylog(" %08x(%d) tag_getTAG tagmap=%08x tag=%08x\n", (int)self, self->ob_refcnt, tagmap, t);
t->next = 0;
t->prev = prevTag;
if(prevTag)
t = tag;
while(t) {
PyObject*newtag = tag_new2(t, taglist->tagmap);
+ if(newtag==NULL) {
+ // pass through exception
+ return NULL;
+ }
PyList_SET_ITEM(taglist->taglist,nr,newtag);Py_INCREF(newtag);
if(swf_isDefiningTag(t)) {
tagmap_add(taglist->tagmap, newtag);