diff options
author | K. \"pestophagous\" Heller <pestophagous@gmail.com> | 2015-12-03 21:42:23 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-12-06 09:37:07 -0800 |
commit | e4c7c6e8eb302cc21c1f643b397ae03c82b03f4b (patch) | |
tree | cc679cafac4314e2a4770e868b01101bb6fd21f0 /save-git.c | |
parent | 27ea07992836076ebb0718e29ee01f5a9e418bfa (diff) | |
download | subsurface-e4c7c6e8eb302cc21c1f643b397ae03c82b03f4b.tar.gz |
Prevent gaschange tank icons from using garbage coords.
Tank icons were shown at incorrect spots on the profile
when the DiveEventItem object held a pointer to a struct
event even after the struct event at that address had
been freed. When internalEvent is a pointer to freed
memory, internalEvent->time.seconds could have all kinds
of crazy values, which get used in member function
DiveEventItem::recalculatePos to place the tank at bad
x coordinates.
The DiveEventItem(s) no longer store a pointer to memory
that they do not own. This way, no matter how the path of
execution arrives into slot recalculatePos, we never need
fear that the DiveEventItem will dereference a garbage
pointer to a struct event.
Fixes #968
Signed-off-by: K. Heller <pestophagous@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'save-git.c')
0 files changed, 0 insertions, 0 deletions