Skip to content

Commit

Permalink
fix crashes reported by Debian Cylab Mayhem Team
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiaskramm committed Jul 26, 2013
1 parent 05c1df6 commit b6e946b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/font2swf.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ static void convertFont(char*infile, char*outfile)
SWFFONT * font;

font = swf_LoadFont(infile, config_flashtype);
if(!font)
exit(1);
swf_FontCreateAlignZones(font);

if(fontname)
Expand Down
3 changes: 3 additions & 0 deletions src/gif2swf.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,9 @@ TAG *MovieAddFrame(SWF * swf, TAG * t, char *sname, int id, int imgidx)
memset(pal, 0, 256 * sizeof(RGBA));

img = &gft->SavedImages[imgidx].ImageDesc;
if(!img) {
exit(1);
}

// Local colormap has precedence over Global colormap
colormap = img->ColorMap ? img->ColorMap : gft->SColorMap;
Expand Down
6 changes: 3 additions & 3 deletions src/png2swf.c
Original file line number Diff line number Diff line change
Expand Up @@ -691,9 +691,9 @@ int args_callback_option(char *arg, char *val)
}

case 'm': {
char*s = strdup(val);
char*c = strchr(s, ':');
if(!c) {
char*s = val ? strdup(val) : NULL;
char*c = s ? strchr(s, ':') : NULL;
if(!s || !c) {
fprintf(stderr, "-m option requires two arguments, <x>:<y>\n");
exit(1);
}
Expand Down
4 changes: 4 additions & 0 deletions src/swfrender.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ int args_callback_option(char*name,char*val)
printf("swfrender - part of %s %s\n", PACKAGE, VERSION);
exit(0);
} else if(!strcmp(name, "o")) {
if(!val) {
fprintf(stderr, "use \"-o <filename>\"\n");
exit(1);
}
outputname = strdup(val);
return 1;
} else if(!strcmp(name, "l")) {
Expand Down

0 comments on commit b6e946b

Please sign in to comment.