psip could be used to look into a map after it has been freed.
From: Erik Hovland <erik@hovland.org>
It really shouldn't be at that point.
---
libs/libmythtv/mpeg/atscstreamdata.cpp | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/libs/libmythtv/mpeg/atscstreamdata.cpp b/libs/libmythtv/mpeg/atscstreamdata.cpp
index 084ea35..5cc3882 100644
a
|
b
|
void ATSCStreamData::DeleteCachedTable(PSIPTable *psip) const |
726 | 726 | if (!psip) |
727 | 727 | return; |
728 | 728 | |
| 729 | bool delete_psip = false; |
| 730 | |
729 | 731 | QMutexLocker locker(&_cache_lock); |
730 | 732 | if (_cached_ref_cnt[psip] > 0) |
731 | 733 | { |
… |
… |
void ATSCStreamData::DeleteCachedTable(PSIPTable *psip) const |
736 | 738 | { |
737 | 739 | if (psip == _cached_mgt) |
738 | 740 | _cached_mgt = NULL; |
739 | | delete psip; |
| 741 | |
| 742 | delete_psip = true; |
740 | 743 | } |
741 | 744 | else if ((TableID::TVCT == psip->TableID()) && |
742 | 745 | _cached_tvcts[psip->tsheader()->PID()]) |
743 | 746 | { |
744 | 747 | _cached_tvcts[psip->tsheader()->PID()] = NULL; |
745 | | delete psip; |
| 748 | delete_psip = true; |
746 | 749 | } |
747 | 750 | else if ((TableID::CVCT == psip->TableID()) && |
748 | 751 | _cached_cvcts[psip->tsheader()->PID()]) |
749 | 752 | { |
750 | 753 | _cached_cvcts[psip->tsheader()->PID()] = NULL; |
751 | | delete psip; |
| 754 | delete_psip = true; |
752 | 755 | } |
753 | 756 | else |
754 | 757 | { |
… |
… |
void ATSCStreamData::DeleteCachedTable(PSIPTable *psip) const |
759 | 762 | it = _cached_slated_for_deletion.find(psip); |
760 | 763 | if (it != _cached_slated_for_deletion.end()) |
761 | 764 | _cached_slated_for_deletion.erase(it); |
| 765 | |
| 766 | if (delete_psip) |
| 767 | { |
| 768 | delete(psip); |
| 769 | psip = NULL; |
| 770 | } |
762 | 771 | } |
763 | 772 | |
764 | 773 | void ATSCStreamData::ReturnCachedTVCTTables(tvct_vec_t &tvcts) const |