polygon intersector: added horizontal line reconstruction
[swftools.git] / lib / jpeg.c
index dee4dfa..66882b0 100644 (file)
@@ -313,13 +313,13 @@ 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++) {
        int x;
        U8 *js = scanline;
-       RGBA*line = (RGBA*)&(*dest)[y*width];
+        RGBA*line = &((RGBA*)(*dest))[y*width];
 
        jpeg_read_scanlines(&cinfo, &js, 1);
        if (cinfo.out_color_space == JCS_GRAYSCALE) {