Skip to content

Commit

Permalink
Temporary fix for JPEG error handle; we need to flag the error in
Browse files Browse the repository at this point in the history
the callback function and test for it in the main code...


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@3969 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
  • Loading branch information
michaelrsweet committed Jan 25, 2005
1 parent 633e4ef commit 1d871d5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGES
@@ -1,5 +1,6 @@
CHANGES IN FLTK 1.1.7

- Fixes to Fl_JPEG_Image error handler.
- Fl_Menu::popup() and ::pulldown() would crash an
application if a callback created widgets before they
returned (STR #685)
Expand Down
10 changes: 4 additions & 6 deletions src/Fl_JPEG_Image.cxx
@@ -1,5 +1,5 @@
//
// "$Id: Fl_JPEG_Image.cxx,v 1.1.2.11 2004/12/16 21:38:24 easysw Exp $"
// "$Id: Fl_JPEG_Image.cxx,v 1.1.2.12 2005/01/25 20:50:25 easysw Exp $"
//
// Fl_JPEG_Image routines.
//
Expand Down Expand Up @@ -91,8 +91,6 @@ Fl_JPEG_Image::Fl_JPEG_Image(const char *jpeg) // I - File to load
jpeg_stdio_src(&cinfo, fp);
jpeg_read_header(&cinfo, 1);

if (cinfo.err->msg_code) goto error_return;

cinfo.quantize_colors = (boolean)FALSE;
cinfo.out_color_space = JCS_RGB;
cinfo.out_color_components = 3;
Expand All @@ -111,8 +109,6 @@ Fl_JPEG_Image::Fl_JPEG_Image(const char *jpeg) // I - File to load

while (cinfo.output_scanline < cinfo.output_height)
{
if (cinfo.err->msg_code) goto error_return;

row = (JSAMPROW)(array +
cinfo.output_scanline * cinfo.output_width *
cinfo.output_components);
Expand All @@ -124,6 +120,7 @@ Fl_JPEG_Image::Fl_JPEG_Image(const char *jpeg) // I - File to load

fclose(fp);

# if 0
// JPEG error handling...
error_return:

Expand All @@ -141,9 +138,10 @@ Fl_JPEG_Image::Fl_JPEG_Image(const char *jpeg) // I - File to load
array = 0;
alloc_array = 0;
}
# endif // 0
#endif // HAVE_LIBJPEG
}

//
// End of "$Id: Fl_JPEG_Image.cxx,v 1.1.2.11 2004/12/16 21:38:24 easysw Exp $".
// End of "$Id: Fl_JPEG_Image.cxx,v 1.1.2.12 2005/01/25 20:50:25 easysw Exp $".
//

0 comments on commit 1d871d5

Please sign in to comment.