]> sigrok.org Git - pulseview.git/commitdiff
DecodeTrace: Don't dereference iterator pointing at end of container.
authorTilman Sauerbeck <redacted>
Wed, 2 Dec 2015 18:45:12 +0000 (19:45 +0100)
committerTilman Sauerbeck <redacted>
Wed, 2 Dec 2015 18:45:12 +0000 (19:45 +0100)
pv/view/decodetrace.cpp

index 38cbecb85337500cf3c20ca5963aa769918bb728..020ce77090acd4d86bc06ba49185be1282106a02 100644 (file)
@@ -733,7 +733,9 @@ QComboBox* DecodeTrace::create_channel_selector(
                {
                        selector->addItem(s->name(),
                                qVariantFromValue((void*)s.get()));
-                       if ((*channel_iter).second == s)
+
+                       if (channel_iter != dec->channels().end() &&
+                               (*channel_iter).second == s)
                                selector->setCurrentIndex(
                                        selector->count() - 1);
                }