mirror of
https://github.com/fltk/fltk.git
synced 2026-06-01 06:14:28 +08:00
Fl_SVG_Image constructor: handle case where file cannot be opened.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12478 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
@@ -103,6 +103,7 @@ static char *svg_inflate(const char *fname) {
|
|||||||
fl_stat(fname, &b);
|
fl_stat(fname, &b);
|
||||||
long size = b.st_size;
|
long size = b.st_size;
|
||||||
gzFile gzf = (gzFile)Fl_SVG_Image::gzopen(fname);
|
gzFile gzf = (gzFile)Fl_SVG_Image::gzopen(fname);
|
||||||
|
if (!gzf) return NULL;
|
||||||
int l;
|
int l;
|
||||||
bool direct = gzdirect(gzf);
|
bool direct = gzdirect(gzf);
|
||||||
long out_size = direct ? size + 1 : 3*size + 1;
|
long out_size = direct ? size + 1 : 3*size + 1;
|
||||||
@@ -288,7 +289,6 @@ int Fl_SVG_Image::draw_scaled(int X, int Y, int W, int H) {
|
|||||||
|
|
||||||
#endif // FLTK_USE_NANOSVG
|
#endif // FLTK_USE_NANOSVG
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// End of "$Id$".
|
// End of "$Id$".
|
||||||
//
|
//
|
||||||
|
|||||||
Reference in New Issue
Block a user