git.asbjorn.biz
/
swftools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
424c701
)
added handling for incomplete tags during file reading.
author
kramm
<kramm>
Mon, 8 Nov 2004 18:19:46 +0000
(18:19 +0000)
committer
kramm
<kramm>
Mon, 8 Nov 2004 18:19:46 +0000
(18:19 +0000)
lib/rfxswf.c
patch
|
blob
|
history
diff --git
a/lib/rfxswf.c
b/lib/rfxswf.c
index
3a8a3ce
..
d7f8f88
100644
(file)
--- a/
lib/rfxswf.c
+++ b/
lib/rfxswf.c
@@
-916,7
+916,12
@@
TAG * swf_ReadTag(struct reader_t*reader, TAG * prev)
if (t->len)
{ t->data = (U8*)rfx_alloc(t->len);
t->memsize = t->len;
if (t->len)
{ t->data = (U8*)rfx_alloc(t->len);
t->memsize = t->len;
- if (reader->read(reader, t->data, t->len) != t->len) return NULL;
+ if (reader->read(reader, t->data, t->len) != t->len) {
+ fprintf(stderr, "rfxswf: Warning: Short read (tagid %d). File truncated?\n", t->id);
+ free(t->data);t->data=0;
+ free(t);
+ return NULL;
+ }
}
if (prev)
}
if (prev)