Browse Source

jpeg.c: fix a huge resource leak in the error codepath of the JPEG codec.

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

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

@@ -68,13 +68,13 @@ 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)
return NULL;

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

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


Loading…
Cancel
Save