octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #42822] index error in graphics.cc:patch::prop


From: Andreas Weber
Subject: [Octave-bug-tracker] [bug #42822] index error in graphics.cc:patch::properties::update_fvc
Date: Tue, 22 Jul 2014 07:26:01 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:30.0) Gecko/20100101 Firefox/30.0 Iceweasel/30.0

URL:
  <http://savannah.gnu.org/bugs/?42822>

                 Summary: index error in
graphics.cc:patch::properties::update_fvc
                 Project: GNU Octave
            Submitted by: andy1978
            Submitted on: Di 22 Jul 2014 07:25:59 GMT
                Category: Plotting
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Regression
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: GNU/Linux

    _______________________________________________________

Details:

Since changeset df972b9d080a "Translate patch property listeners to C++ (bug
#42159)" the demos

area 1, copyobj 2, legend 18, legend 19, legend 35, pie3 1, pie3 2, pie3 3,
ribbon 1 fail with A(I,J): row index out of bounds; value 2 out of bound 1 or
A(I,J): column index out of bounds; value 3 out of bound 2

when configured and built with "./configure FFLAGS=-g CFLAGS=-g CXXFLAGS=-g
--enable-bounds-check" without "--enable-bounds-check" there is no error.

A minimalistiv testcase:

octave:1> area([0;1;0])
octave:2> legend('a')
error: __go_patch__: A(I,J): row index out of bounds; value 2 out of bound 1
error: called from:
error:  
/home/andy/src/octave-default-dbg-build/../octave-src/scripts/plot/draw/private/__patch__.m
at line 189, column 7
error:  
/home/andy/src/octave-default-dbg-build/../octave-src/scripts/plot/draw/patch.m
at line 87, column 16
error:  
/home/andy/src/octave-default-dbg-build/../octave-src/scripts/plot/appearance/legend.m
at line 885, column 20


The problem in in graphics.cc:patch::properties::update_fvc


  octave_idx_type nr = xd.rows ();
  octave_idx_type nc = xd.columns ();
  if (nr == 1 && nc > 1)
    {
      nr = nc;
      nc = 1;
      xd = xd.transpose ();
    }

...
  octave_idx_type kk = 0;
  for (octave_idx_type jj = 0; jj < nc; jj++)
    {
      for (octave_idx_type ii = 0; ii < nr; ii++)
        {
          vert(kk,0) = xd(ii,jj); <-- xd got transposed
          vert(kk,1) = yd(ii,jj); <-- yd not, index error


where xd got transposed but yd not. Therefore yd(ii,jj) triggers an indexing
error.





    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?42822>

_______________________________________________
  Nachricht gesendet von/durch Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]