Browse Source

clean up styling

v1.x
Tj Holowaychuk 13 years ago
parent
commit
323e24ba42
  1. 29
      src/Image.cc

29
src/Image.cc

@ -613,17 +613,18 @@ Image::loadJPEGFromBuffer(uint8_t *buf, unsigned len) {
// Data alloc
int stride = width * 4;
uint8_t *data = (uint8_t *) malloc(width * height * 4);
if (!data) {
jpeg_finish_decompress(&info);
jpeg_destroy_decompress(&info);
return CAIRO_STATUS_NO_MEMORY;
jpeg_finish_decompress(&info);
jpeg_destroy_decompress(&info);
return CAIRO_STATUS_NO_MEMORY;
}
uint8_t *src = (uint8_t *) malloc(width * 3);
if (!src) {
free(data);
jpeg_finish_decompress(&info);
jpeg_destroy_decompress(&info);
jpeg_finish_decompress(&info);
jpeg_destroy_decompress(&info);
return CAIRO_STATUS_NO_MEMORY;
}
@ -683,19 +684,21 @@ Image::loadJPEG(FILE *stream) {
// Data alloc
int stride = width * 4;
uint8_t *data = (uint8_t *) malloc(width * height * 4);
if (!data) {
fclose(stream);
jpeg_finish_decompress(&info);
jpeg_destroy_decompress(&info);
return CAIRO_STATUS_NO_MEMORY;
fclose(stream);
jpeg_finish_decompress(&info);
jpeg_destroy_decompress(&info);
return CAIRO_STATUS_NO_MEMORY;
}
uint8_t *src = (uint8_t *) malloc(width * 3);
if (!src) {
free(data);
fclose(stream);
jpeg_finish_decompress(&info);
jpeg_destroy_decompress(&info);
fclose(stream);
jpeg_finish_decompress(&info);
jpeg_destroy_decompress(&info);
return CAIRO_STATUS_NO_MEMORY;
}

Loading…
Cancel
Save