Browse Source

Fix a crash in the JPEG loader when meeting with ENOENT.

git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/libpipi/trunk@3401 92316355-f0b4-4df1-b90c-862c8a59935f
master
sam 16 years ago
parent
commit
05c7be55fc
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      pipi/codec/jpeg.c

+ 4
- 4
pipi/codec/jpeg.c View File

@@ -68,12 +68,12 @@ pipi_image_t *pipi_load_jpeg(const char *name)
unsigned int i, j, k = 0;
FILE *fp;

if(setjmp(jerr.setjmp_buffer))
return NULL;

fp = fopen(name, "rb");
if(!fp)
goto end;

if(setjmp(jerr.setjmp_buffer))
goto end;
return NULL;

cinfo.err = jpeg_std_error(&jerr.pub);
jerr.pub.error_exit = error_msg;


Loading…
Cancel
Save