Comment 5 for bug 1173355

Revision history for this message
Emmanuel (hacker-emmanuel) wrote :

I realize that previous comments need a few edits for typos and mistakes but overall the meaning should be recoverable.

Anyway in comment #4 the current problematic stellarium implementation of StelSphereGeometry is:
625 projectSphericalTriangle(projector, clippingCap, &va, &ta, buffer, maxSqDistortion, nbI+1, true, false, true);
and not:
625 projectSphericalTriangle(projector, clippingCap, &va, texCoords ? &ta : 0, buffer, maxSqDistortion, nbI+1, true,
as suggested in the code extract. The latter is actually the proposed correction.

In comment #2 a more efficient solution for fixing the memory handling error would be replacing:
  762 const QVector<Vec3d> &vertices = getOctahedronPolygon().fillVertices ();
With:
 762 const OctahedronPolygon &octahedron = getOctahedronPolygon();
 763 const QVector<Vec3d> &vertices = octahedron.fillVertices ();
The added const reference on temporary object 'octahedron' extends its lifetime so that it is now legit to get a reference to its vertices and use it in the scope of the function. Doing so the program no longer crashes and valgrind no longer complains.

These issues seemingly arise only for third-party plugin developpers using otherwise unused stellarium code, so does not affect users of the stellarium base application and plugins, and is not immediate to reproduce.
For my immediate concern it's possible to embed a corrected redefinition of the relevant functions in my plugins to supersede the original ones, but ultimately it would be better to fix the stellarium code base.
Would that be ok for me to submit a patch including the above-mentionned corrections?