Commit c4392dd3 authored by chrisryancombs's avatar chrisryancombs Committed by Makayla Shepherd
Browse files

Fixed segfault in TgoCassisCamera when unable to find keywords using spiceinit. Fixes #5163.

parent d5a21ea8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -418,7 +418,7 @@ bool tryKernels(Cube *icube, Process &p,

      Application::Log(currentKernels);
      icube->putGroup(originalKernels);
      throw;
      throw IException(e);
    }

    if (ui.GetBoolean("ATTACH")) {
+4 −0
Original line number Diff line number Diff line
@@ -286,6 +286,10 @@
      Updated spiceinit to remove code dealing with the CubeSupported Pvl Keyword, from the ShapeModel group in the IsisPreferences file, 
      which has been removed.
    </change>
    <change name="Christopher Combs" date="2018-01-11">
      Made change to camera construction error throw for better reporting on uninstantiated cameras.
      Fixes #5163.
    </change>
  </history>

  <oldName>
+6 −6
Original line number Diff line number Diff line
@@ -2347,8 +2347,8 @@ namespace Isis {
   *
   * @param *map Pointer to a CameraDistortionMap object
   */
  void Camera::SetDistortionMap(CameraDistortionMap *map) {
    if (p_distortionMap) {
 void Camera::SetDistortionMap(CameraDistortionMap *map, bool deleteExisting) {
     if (deleteExisting && p_distortionMap) {
         delete p_distortionMap;
     }

+3 −1
Original line number Diff line number Diff line
@@ -239,6 +239,8 @@ namespace Isis {
   *                           an error in the original formula, and updated the documention for this
   *                           function.  Fixes #4614.
   *   @history 2017-08-30 Summer Stapleton - Updated documentation. References #4807.
   *   @history 2017-01-11 Christopher Combs - Added bool deleteExisting to SetDistortionMap to 
   *                           prevent a segfault when the distortion map is incomplete. Fixes $5163.
   */

  class Camera : public Sensor {
@@ -332,7 +334,7 @@ namespace Isis {
      QString spacecraftNameLong() const;
      QString spacecraftNameShort() const;

      void SetDistortionMap(CameraDistortionMap *map);
      void SetDistortionMap(CameraDistortionMap *map, bool deleteExisting = true);
      void SetFocalPlaneMap(CameraFocalPlaneMap *map);
      void SetDetectorMap(CameraDetectorMap *map);
      void SetGroundMap(CameraGroundMap *map);
+9 −2
Original line number Diff line number Diff line
@@ -101,8 +101,15 @@ namespace Isis {
    focalMap->SetDetectorOrigin(bsSample, bsLine);

    // Setup distortion map
    try {
      new TgoCassisDistortionMap(this, naifIkCode());

    }
    catch (IException &e) {
      // Set NULL so that cameras destructor wont seg fault trying to delete
      SetDistortionMap(NULL, false);
      QString msg = "Unable to Create TgoCassisDistortionMap";
      throw IException(e, IException::Unknown, msg, _FILEINFO_);
    }
    // Setup the ground and sky map
    new CameraGroundMap(this);
    new CameraSkyMap(this);
Loading