X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fdevices%2Fswf.c;h=8ba141a5fa302fcf5054580ae106083da46febf9;hb=5b97294f0d92194820e794198456542dcf1bf3fe;hp=3bbf8ee258d871ff535a0279c908f37a442e1c14;hpb=76fe35b774bd7b7376eb85464a7afe3c81330eea;p=swftools.git diff --git a/lib/devices/swf.c b/lib/devices/swf.c index 3bbf8ee..8ba141a 100644 --- a/lib/devices/swf.c +++ b/lib/devices/swf.c @@ -1876,16 +1876,20 @@ static int add_image(swfoutput_internal*i, gfximage_t*img, int targetwidth, int /// { if(is_jpeg && i->config_jpegsubpixels) { - newsizex = (int)(targetwidth*i->config_jpegsubpixels+0.5); - newsizey = (int)(targetheight*i->config_jpegsubpixels+0.5); + newsizex = (int)(targetwidth*i->config_jpegsubpixels + 0.5); + newsizey = (int)(targetheight*i->config_jpegsubpixels + 0.5); } else if(!is_jpeg && i->config_ppmsubpixels) { - newsizex = (int)(targetwidth*i->config_ppmsubpixels+0.5); - newsizey = (int)(targetheight*i->config_ppmsubpixels+0.5); + newsizex = (int)(targetwidth*i->config_ppmsubpixels + 0.5); + newsizey = (int)(targetheight*i->config_ppmsubpixels + 0.5); } /// } - if(sizex<=0 || sizey<=0 || newsizex<=0 || newsizey<=0) + if(sizex<=0 || sizey<=0) return -1; + if(newsizex<=0) + newsizex = 1; + if(newsizey<=0) + newsizey = 1; /* TODO: cache images */