Skip to content

Commit

Permalink
shiftmap: Avoid possible segfault in MapMerge
Browse files Browse the repository at this point in the history
  • Loading branch information
dsberry committed Aug 20, 2020
1 parent 7abb94b commit 7e7fd92
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/shiftmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ f The ShiftMap class does not define any new routines beyond those
* Override astEqual.
* 26-SEP-2019 (DSB):
* Added protected method astGetShifts
* 20-AUG-2020 (DSB):
* Avoid possible segfault in MapMerge.
*class--
*/

Expand Down Expand Up @@ -717,7 +719,7 @@ static int MapMerge( AstMapping *this, int where, int series, int *nmap,
/* We also revert the WinMap back to the original ShiftMap if the above
call to astMapMerge made no changes. */
if( revert || ( result == -1 ) ){
(void) astAnnul( ( *map_list )[ where ] );
if( ( *map_list )[ where ] ) astAnnul( ( *map_list )[ where ] );

/* If the original ShiftMap was used in an inverted sense, we can at least
ensure that the returned ShiftMap is used in a forward sense. Take a
Expand Down

0 comments on commit 7e7fd92

Please sign in to comment.