diff --git a/libretro-common/formats/image_transfer.c b/libretro-common/formats/image_transfer.c index 5bc554f0a7..d01c44b5bb 100644 --- a/libretro-common/formats/image_transfer.c +++ b/libretro-common/formats/image_transfer.c @@ -38,6 +38,7 @@ void *image_transfer_new(enum image_type_enum type) break; case IMAGE_TYPE_JPEG: #ifdef HAVE_RJPEG + return rjpeg_alloc(); #endif break; } diff --git a/libretro-common/formats/jpeg/rjpeg.c b/libretro-common/formats/jpeg/rjpeg.c index a9ca0b753f..6ae2afd3c4 100644 --- a/libretro-common/formats/jpeg/rjpeg.c +++ b/libretro-common/formats/jpeg/rjpeg.c @@ -33,6 +33,7 @@ #include #include #include +#include #include enum @@ -64,6 +65,11 @@ typedef struct int ypos; /* which pre-expansion row we're on */ } rjpeg__resample; +struct rjpeg +{ + void *empty; +}; + #ifdef _MSC_VER #define RJPEG_HAS_LROTL #endif @@ -2460,3 +2466,11 @@ bool rjpeg_image_load(uint8_t *_buf, void *data, size_t size, return true; } + +void *rjpeg_alloc(void) +{ + rjpeg_t *rjpeg = (rjpeg_t*)calloc(1, sizeof(*rjpeg)); + if (!rjpeg) + return NULL; + return rjpeg; +} diff --git a/libretro-common/include/formats/rjpeg.h b/libretro-common/include/formats/rjpeg.h index 81f61b92af..62fafb4123 100644 --- a/libretro-common/include/formats/rjpeg.h +++ b/libretro-common/include/formats/rjpeg.h @@ -32,9 +32,13 @@ RETRO_BEGIN_DECLS +typedef struct rjpeg rjpeg_t; + bool rjpeg_image_load(uint8_t *buf, void *data, size_t size, unsigned a_shift, unsigned r_shift, unsigned g_shift, unsigned b_shift); +void *rjpeg_alloc(void); + RETRO_END_DECLS #endif