bugGNU Octave - Bugs: bug #54918, uicontrol: validation of cdata...

 
 

bug #54918: uicontrol: validation of cdata property

Submitter:  Guillaume <gyom>
Submitted:  Tue 30 Oct 2018 03:10:57 PM UTC
   
 
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error or Warning
Status:  Fixed Assigned to:  rik5
Originator Name:  Guillaume Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 30 Oct 2018 06:50:38 PM UTC, comment #4: 

I checked in a better and more complete fix here (https://hg.savannah.gnu.org/hgweb/octave/rev/d7e2fd922288).  The problem with only adding "dim_vector (0,0)" is that this disabled any 2-D checking.  It was then possible to set cdata to ones (1,2) which was meant to be excluded since only RGB data can be used for the "cdata" property of a uicontrol object.

I think this is fixed now, although we can re-open it if you encounter further errors.

Rik <rik5>
Group administrator
Tue 30 Oct 2018 06:11:19 PM UTC, comment #3: 

I was also about to suggest adding a dim_vector (0, 0) constraint for cdata.  That seems to be what other array properties have.  Is some other trouble caused by doing that?

John W. Eaton <jwe>
Group administrator
Tue 30 Oct 2018 06:07:22 PM UTC, comment #2: 

Thanks for looking into this, Rik.
Your change below fixes the problem for me:
https://hg.savannah.gnu.org/hgweb/octave/rev/63b3d5e4e5c3
but I guess you find the checks too lenient now?

Guillaume <gyom>
Tue 30 Oct 2018 05:46:53 PM UTC, comment #1: 

This is way trickier than it first appeared.  I have some idea of how to fix it, but it means larger changes for how constraints are processed.

Rik <rik5>
Group administrator
Tue 30 Oct 2018 03:10:57 PM UTC, original submission:  

It seems that the validation of an uicontrol cdata property is a bit too tight as it doesn't allow an empty array []:


>> figure, h = uicontrol ();
>> get (h, "cdata")
ans = [](0x0)
>> set (h, "cdata", [])
error: invalid value for array property "cdata"
>> set (h, "cdata", zeros(0,0,0))
>>


i.e. it does not allow its own default value.

I assume the fix is about changing this line:
http://hg.savannah.gnu.org/hgweb/octave/file/69a160d7ab68/libinterp/corefcn/graphics.in.h#l5476
but am not sure exactly how.

Guillaume <gyom>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by gyom (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-10-30 rik5 StatusIn Progress Fixed
        Open/ClosedOpen Closed
    2018-10-30 rik5 StatusNone In Progress
        Assigned toNone rik5

    Back to the top

    Powered by Savane 3.13-ec04.
    Corresponding source code