mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2026-08-08 11:33:03 +00:00
fix leak in do_jpeg_encode
Issue found by the Coverity scanner. HDG: Fixup don't free RGB24_line if it was not allocated by do_jpeg_encode Signed-off-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
parent
a09052b83c
commit
8c9404374a
@ -194,6 +194,10 @@ static void do_jpeg_encode(JpegEncoder *jpeg, uint8_t *lines, unsigned int num_l
|
||||
row_pointer[0] = RGB24_line;
|
||||
jpeg_write_scanlines(&jpeg->cinfo, row_pointer, 1);
|
||||
}
|
||||
|
||||
if (jpeg->cur_image.type != JPEG_IMAGE_TYPE_RGB24) {
|
||||
free(RGB24_line);
|
||||
}
|
||||
}
|
||||
|
||||
int jpeg_encode(JpegEncoderContext *jpeg, int quality, JpegEncoderImageType type,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user