1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

[sixel] Big memory leak

This commit is contained in:
Witold Filipczyk 2023-05-26 13:13:00 +02:00
parent 715c16f4d1
commit 82d76921cd

View File

@ -863,6 +863,7 @@ copy_frame(struct image *src, int box_width, int box_height, int cell_width, int
{ {
sixel_decoder_t *decoder = NULL; sixel_decoder_t *decoder = NULL;
sixel_encoder_t *encoder = NULL; sixel_encoder_t *encoder = NULL;
sixel_output_t *output = NULL;
sixel_frame_t *frame = NULL; sixel_frame_t *frame = NULL;
unsigned char *indexed_pixels = NULL; unsigned char *indexed_pixels = NULL;
unsigned char *palette = NULL; unsigned char *palette = NULL;
@ -931,7 +932,6 @@ copy_frame(struct image *src, int box_width, int box_height, int cell_width, int
encoder->clipy = y >= 0 ? 0 : (-y * cell_height); encoder->clipy = y >= 0 ? 0 : (-y * cell_height);
encoder->clipwidth = box_width * cell_width; encoder->clipwidth = box_width * cell_width;
encoder->clipheight = box_height * cell_height; encoder->clipheight = box_height * cell_height;
sixel_output_t *output = NULL;
status = sixel_output_new(&output, sixel_write_callback, &dest->pixels, NULL); status = sixel_output_new(&output, sixel_write_callback, &dest->pixels, NULL);
if (SIXEL_FAILED(status)) { if (SIXEL_FAILED(status)) {
@ -948,6 +948,7 @@ copy_frame(struct image *src, int box_width, int box_height, int cell_width, int
dest->height = src->height; dest->height = src->height;
end: end:
sixel_frame_unref(frame); sixel_frame_unref(frame);
sixel_output_unref(output);
sixel_decoder_unref(decoder); sixel_decoder_unref(decoder);
sixel_encoder_unref(encoder); sixel_encoder_unref(encoder);