# HG changeset patch # User Rik # Date 1455563092 28800 # Node ID cf2eae837cc82f5f193a3c868ca8b6a17d2372fd # Parent f982cfe3df03b8348f26d6cf06dd5fc230643c93 Fix imshow segfault when data cannot be converted to appropriate type (bug #46933). * graphics.cc (convert_cdata): Replace error with a warning when data can not be converted to an appropriate type. diff -r f982cfe3df03 -r cf2eae837cc8 libinterp/corefcn/graphics.cc --- a/libinterp/corefcn/graphics.cc Tue Jan 26 15:52:21 2016 +1100 +++ b/libinterp/corefcn/graphics.cc Mon Feb 15 11:04:52 2016 -0800 @@ -959,7 +959,13 @@ else if (cdata.is_bool_type ()) CONVERT_CDATA_1 (boolNDArray, bool_, false); else - error ("unsupported type for cdata (= %s)", cdata.type_name ().c_str ()); + { + // Don't throw an error; leads to an incomplete FLTK object (bug #46933). + warning ("unsupported type for cdata (= %s). " + "Valid types are uint8, uint16, double, single, and bool.", + cdata.type_name ().c_str ()); + a = NDArray (dv, 0); // return 0 instead + } #undef CONVERT_CDATA_1