mirror of
https://github.com/hyprwm/hyprlock.git
synced 2024-12-22 05:19:48 +01:00
helpers: fix jpeg and webp OOM error (#401)
* Update Jpeg.cpp * Update Webp.cpp
This commit is contained in:
parent
29420ddb6c
commit
6e0921140e
2 changed files with 2 additions and 0 deletions
|
@ -66,6 +66,7 @@ cairo_surface_t* JPEG::createSurfaceFromJPEG(const std::filesystem::path& path)
|
|||
jpeg_read_scanlines(&decompressStruct, &rowRead, 1);
|
||||
}
|
||||
|
||||
cairo_surface_flush(cairoSurface);
|
||||
cairo_surface_mark_dirty(cairoSurface);
|
||||
cairo_surface_set_mime_data(cairoSurface, CAIRO_MIME_TYPE_JPEG, (const unsigned char*)imageRawData, fileInfo.st_size, free, imageRawData);
|
||||
jpeg_finish_decompress(&decompressStruct);
|
||||
|
|
|
@ -74,6 +74,7 @@ cairo_surface_t* WEBP::createSurfaceFromWEBP(const std::filesystem::path& path)
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
cairo_surface_flush(cairoSurface);
|
||||
cairo_surface_mark_dirty(cairoSurface);
|
||||
cairo_surface_set_mime_data(cairoSurface, CAIRO_MIME_TYPE_PNG, (const unsigned char*)imageRawData, fileInfo.st_size, free, imageRawData);
|
||||
|
||||
|
|
Loading…
Reference in a new issue