GUAC-236: Do not resize buffers if unnecessary.
This commit is contained in:
parent
ba9c1a2efd
commit
e3d0c5e5ef
@ -74,6 +74,10 @@ void guacenc_buffer_free(guacenc_buffer* buffer) {
|
|||||||
|
|
||||||
int guacenc_buffer_resize(guacenc_buffer* buffer, int width, int height) {
|
int guacenc_buffer_resize(guacenc_buffer* buffer, int width, int height) {
|
||||||
|
|
||||||
|
/* Ignore requests which do not change the size */
|
||||||
|
if (buffer->width == width && buffer->height == height)
|
||||||
|
return 0;
|
||||||
|
|
||||||
/* Simply deallocate if new image has absolutely no pixels */
|
/* Simply deallocate if new image has absolutely no pixels */
|
||||||
if (width == 0 || height == 0) {
|
if (width == 0 || height == 0) {
|
||||||
guacenc_buffer_free_image(buffer);
|
guacenc_buffer_free_image(buffer);
|
||||||
|
Loading…
Reference in New Issue
Block a user