diff --git a/ext/fox16_c/FXRuby.cpp b/ext/fox16_c/FXRuby.cpp
index 11f2ab13c670cb6f5f1630f69ab1bd74f1b1cf36..61f1715b5b834edc5ad4fdccb02d4f80c4739618 100644
--- a/ext/fox16_c/FXRuby.cpp
+++ b/ext/fox16_c/FXRuby.cpp
@@ -481,6 +481,7 @@ FXColor *FXRbConvertToFXColors(VALUE string_or_ary, FXuint *opts){
         memcpy(pix, RSTRING_PTR(string_or_ary), RSTRING_LEN(string_or_ary));
       }
     }else{
+      rb_str_modify(string_or_ary);
       pix = (FXColor*)(RSTRING_PTR(string_or_ary));
     }
   }