From dea754d846087b0a2cb097e107f2f8020fe234bd Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Sat, 27 Feb 2016 15:26:47 -0800 Subject: [PATCH] GUAC-236: Handle dispose of buffers. --- src/guacenc/instruction-dispose.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/guacenc/instruction-dispose.c b/src/guacenc/instruction-dispose.c index d6204905..a6cd4203 100644 --- a/src/guacenc/instruction-dispose.c +++ b/src/guacenc/instruction-dispose.c @@ -39,8 +39,12 @@ int guacenc_handle_dispose(guacenc_display* display, int argc, char** argv) { /* Parse arguments */ int index = atoi(argv[0]); - /* Dispose of layer */ - return guacenc_display_free_layer(display, index); + /* If non-negative, dispose of layer */ + if (index >= 0) + return guacenc_display_free_layer(display, index); + + /* Otherwise, we're referring to a buffer */ + return guacenc_display_free_buffer(display, index); }