[mythtv-commits] mythtv commit: r10935 by danielk

mythtv at cvs.mythtv.org mythtv at cvs.mythtv.org
Thu Aug 24 00:52:43 UTC 2006


      Author: danielk
        Date: 2006-08-24 00:52:42 +0000 (Thu, 24 Aug 2006)
New Revision: 10935
   Changeset: http://cvs.mythtv.org/trac/changeset/10935

Modified:

   trunk/mythtv/libs/libmythtv/channelutil.cpp

Log:

Fixes segfault reported by Robert Kulagowski with lots of testing by Robert and insight from Anduin Withers.

The root of our the problem was a violation of strict weak ordering.

"a<b & b<c -> a<c" could be violated if a&c were compared as ints and a&b and b&c were compared strings, or vice versa.

This fixes that problem in lt_smart by making sure any numeric channum is always considered less than a non-numeric channum.

Also to avoid any future problems if strict weak ordering is violated by a comparison function, I've changed the sort from an unstable sort to a stable sort in sort channels, so any future problems like this won't cause segfaults. The stable sort technically requires a strict weak ordering as well, but in practice STL uses a merge sort which safely handles problems in the comparison function.






More information about the mythtv-commits mailing list