Skip to content

Commit c45afd9

Browse files
committed
test/decoder_gltex/main: compilation fix
1 parent fb653c0 commit c45afd9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/decoder_gltex/main.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,13 @@ int main(int argc, char *argv[])
6868
gpujpeg_image_destroy(image_old);
6969

7070
// Get image size and check number of color components
71+
struct gpujpeg_parameters param;
7172
struct gpujpeg_image_parameters param_image;
72-
if (0 != gpujpeg_decoder_get_image_info(image, image_size, &param_image, NULL, 0 /* verbose */)) {
73+
if (0 != gpujpeg_decoder_get_image_info(image, image_size, &param_image, &param, 0 /* verbose */)) {
7374
fprintf(stderr, "Failed to read image size from file [%s]!\n", input_filename);
7475
return -1;
7576
}
76-
if (param_image.comp_count != 3) {
77+
if (param.comp_count != 3) {
7778
fprintf(stderr, "Only JPEG images with 3 color components can be decoded into OpenGL texture!\n");
7879
return -1;
7980
}
@@ -122,7 +123,7 @@ int main(int argc, char *argv[])
122123
// Get data from OpenGL texture
123124
uint8_t* data = NULL;
124125
size_t data_size = 0;
125-
data = malloc(param_image.width * param_image.height * param_image.comp_count);
126+
data = malloc(param_image.width * param_image.height * param.comp_count);
126127
gpujpeg_opengl_texture_get_data(texture->texture_id, data, &data_size);
127128

128129
// Save image

0 commit comments

Comments
 (0)