Skip to content

Commit 8477815

Browse files
committed
fix a crash when the some IIO stacks are not active
Change-Id: Ic468aa101fd6648579babcb73c615c5ed780a4e5
1 parent df69840 commit 8477815

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/pcm-iio.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1035,7 +1035,7 @@ result_content get_IIO_Samples(PCM *m, const std::vector<struct iio_stacks_on_so
10351035
uint64 rawEvents[4] = {0};
10361036
std::unique_ptr<ccr> pccr(get_ccr(m, ctr.ccr));
10371037
rawEvents[ctr.idx] = pccr->get_ccr_value();
1038-
int stacks_count = (int)iios[0].stacks.size();
1038+
const int stacks_count = (int)m->getMaxNumOfIIOStacks();
10391039
before = new IIOCounterState[iios.size() * stacks_count];
10401040
after = new IIOCounterState[iios.size() * stacks_count];
10411041

0 commit comments

Comments
 (0)