pass the address of the pointer, not the pointer itself, to jpeg_write_scanlines