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


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

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

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


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>
Project 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) = [];
    ## Default values.
    r = [0.55, 0.6, 0.4, 10];

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>
Project Administrator


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

Attach Files:

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)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project 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.5