fixed format warnings
[swftools.git] / lib / jpeg.c
index b0059b8..71483f6 100644 (file)
@@ -227,7 +227,7 @@ boolean mem_fill_input_buffer (j_decompress_ptr cinfo)
 void mem_skip_input_data (j_decompress_ptr cinfo, long num_bytes)
 {
     struct jpeg_source_mgr* mgr = cinfo->src;
-    printf("skip %d +%d\n", size - mgr->bytes_in_buffer, num_bytes);
+    printf("skip %d +%ld\n", size - mgr->bytes_in_buffer, num_bytes);
     if(num_bytes<=0)
        return;
     mgr->next_input_byte += num_bytes;
@@ -313,7 +313,7 @@ int jpeg_load(const char*filename, unsigned char**dest, int*_width, int*_height)
 
     int width = *_width = cinfo.output_width;
     int height = *_height = cinfo.output_height;
-    *dest = malloc(width*height*4);
+    *dest = (unsigned char*)malloc(width*height*4);
 
     int y;
     for (y=0;y<height;y++) {
@@ -362,6 +362,7 @@ int jpeg_load(const char*filename, unsigned char**dest, int*_width, int*_height)
 
     jpeg_finish_decompress(&cinfo);
     jpeg_destroy_decompress(&cinfo);
+    fclose(fi);
     return 1;
 }