changeset 16964:eb7c0c2dc6d2

imwrite: fix bug due to uninitialized variable with no options (bug #39472)
author Carnë Draug <carandraug@octave.org>
date Fri, 12 Jul 2013 14:59:08 +0100
parents ad92406ec915
children 786a50507bbd
files scripts/image/private/core_imwrite.m
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/image/private/core_imwrite.m	Fri Jul 12 02:05:17 2013 -0500
+++ b/scripts/image/private/core_imwrite.m	Fri Jul 12 14:59:08 2013 +0100
@@ -29,9 +29,9 @@
 
   [filename, ext, map, param_list] = imwrite_filename (varargin{2:end});
 
-  if (isempty (options))
-    has_param_list = false;
-  else
+  options        = struct ();
+  has_param_list = false;
+  if (! isempty (param_list))
     has_param_list = true;
     for ii = 1:2:(length (param_list))
       options.(param_list{ii}) = param_list{ii + 1};