mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 11:28:05 +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>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41325>
This commit is contained in:
parent
653ef90403
commit
4c46cd8e9d
1 changed files with 1 additions and 1 deletions
|
|
@ -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