bugGNU Octave - Bugs: bug #55180, surfl errors on valid 4x4 input...

 
 

bug #55180: surfl errors on valid 4x4 input matrix

Submitter:  Rik <rik5>
Submitted:  Fri 07 Dec 2018 04:30:26 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error or Warning
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 11 Dec 2018 12:59:07 AM UTC, comment #1: 

Fixed in this cset https://hg.savannah.gnu.org/hgweb/octave/rev/b8f23ab958e8.  Closing report.

Rik <rik5>
Group administrator
Fri 07 Dec 2018 04:30:26 PM UTC, original submission:  

Valid calling form for surfl is


surfl (Z)


where Z is a 2-D real matrix.

However, this fails when Z has four columns


Z = rand (4,4);
surfl (Z)
error: varargin(0): subscripts must be either integers 1 to (2^63)-1 or logicals
error: called from
    surfl at line 122 column 3


Trouble seems to be in the input validation here


  ## Check for reflection properties argument.
  ##
  ## r = [ambient light strength,
  ##      diffuse reflection strength,
  ##      specular reflection strength,
  ##      specular shine]
  if (isnumeric (varargin{end}) && length (varargin{end}) == 4)
    r = varargin{end};
    varargin(end) = [];
  else
    ## Default values.
    r = [0.55, 0.6, 0.4, 10];
  endif


At the very least, should be checking for a 1x4 vector.  This would prevent misinterpretation of an array that happens to have number of rows or number of columns equal to 4.

The input validation for light vector should also be checked because it might have the same issues.


Rik <rik5>
Group administrator

 

(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 rik5 (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 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-12-11 rik5 StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code