mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 04:48:08 +02:00
vulkan/screenshot-layer: initialize info to NULL
Initialize 'info' to NULL to avoid use of potentially uninitialized value at the cleanup label when an earlier error causes a goto before png_create_info_struct() is reached. screenshot.cpp:808:9: warning: variable 'info' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] screenshot.cpp:814:9: warning: variable 'info' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] Fixes:eda55c7c2f("vulkan/screenshot-layer: Add Vulkan screenshot layer") Signed-off-by: Vinson Lee <vlee@freedesktop.org> Reviewed-by: Casey Bowman <casey.g.bowman@intel.com> (cherry picked from commit4c46cd8e9d) Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41402>
This commit is contained in:
parent
bcc058876a
commit
dd927e1e83
2 changed files with 2 additions and 2 deletions
|
|
@ -514,7 +514,7 @@
|
|||
"description": "vulkan/screenshot-layer: initialize info to NULL",
|
||||
"nominated": true,
|
||||
"nomination_type": 2,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "eda55c7c2f695492e8ebdd26725e5be5ee66eb1c",
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -790,7 +790,7 @@ void *writePNG(void *data) {
|
|||
char *tmpFilename = (char *)malloc(length + 4); // Allow for ".tmp"
|
||||
VkResult res;
|
||||
png_byte *row_pointer;
|
||||
png_infop info;
|
||||
png_infop info = NULL;
|
||||
png_struct* png;
|
||||
uint64_t rowPitch = threadData->srLayout.rowPitch;
|
||||
uint64_t start_time, end_time;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue