mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-11-02 09:01:38 -05:00 
			
		
		
		
	output_state: Gamma lut should be freed only if committed
We consider state that is not committed to be uninitialized.
This commit is contained in:
		
							parent
							
								
									3ee0f52e09
								
							
						
					
					
						commit
						64c0272f81
					
				
					 1 changed files with 3 additions and 1 deletions
				
			
		| 
						 | 
					@ -112,8 +112,10 @@ bool wlr_output_state_set_gamma_lut(struct wlr_output_state *state,
 | 
				
			||||||
		memcpy(gamma_lut + ramp_size, g, ramp_size * sizeof(uint16_t));
 | 
							memcpy(gamma_lut + ramp_size, g, ramp_size * sizeof(uint16_t));
 | 
				
			||||||
		memcpy(gamma_lut + 2 * ramp_size, b, ramp_size * sizeof(uint16_t));
 | 
							memcpy(gamma_lut + 2 * ramp_size, b, ramp_size * sizeof(uint16_t));
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
 | 
							if (state->committed & WLR_OUTPUT_STATE_GAMMA_LUT) {
 | 
				
			||||||
			free(state->gamma_lut);
 | 
								free(state->gamma_lut);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	state->committed |= WLR_OUTPUT_STATE_GAMMA_LUT;
 | 
						state->committed |= WLR_OUTPUT_STATE_GAMMA_LUT;
 | 
				
			||||||
	state->gamma_lut_size = ramp_size;
 | 
						state->gamma_lut_size = ramp_size;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue