X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fviews%2Ftabular_decoder%2Fmodel.cpp;fp=pv%2Fviews%2Ftabular_decoder%2Fmodel.cpp;h=d85bf6aac7721d38106292254b811c30896426e7;hb=6f2f5d25db4f9a674ca25e5b74caf518ecd38ff6;hp=b87bf05869ef1f118ad69853ff3899ec4e1d097a;hpb=4ef27380afd5d75d49b811c248efb39138037ae4;p=pulseview.git diff --git a/pv/views/tabular_decoder/model.cpp b/pv/views/tabular_decoder/model.cpp index b87bf058..d85bf6aa 100644 --- a/pv/views/tabular_decoder/model.cpp +++ b/pv/views/tabular_decoder/model.cpp @@ -164,8 +164,11 @@ uint8_t AnnotationCollectionModel::first_hidden_column() const QVariant AnnotationCollectionModel::headerData(int section, Qt::Orientation orientation, int role) const { + if ((section < 0) || (section >= (int)header_data_.size())) + return QVariant(); + if ((orientation == Qt::Horizontal) && (role == Qt::DisplayRole)) - return header_data_.at(section); + return header_data_[section]; return QVariant(); }