[Kst] extragear/graphics/kst/kst
Barth Netterfield
netterfield at astro.utoronto.ca
Sat Jan 28 01:36:40 CET 2006
SVN commit 503057 by netterfield:
BUG: 120823
Read past EOF results in a vector of 1 sample = NaN.
M +7 -2 kstrvector.cpp
--- trunk/extragear/graphics/kst/kst/kstrvector.cpp #503056:503057
@@ -430,7 +430,8 @@
int i, k, shift, n_read=0;
int ave_nread;
int new_f0, new_nf;
-
+ bool start_past_eof = false;
+
checkIntegrity();
if (DoSkip && Skip < 2 && SPF == 1) {
@@ -462,6 +463,7 @@
// Tried to read starting past the end.
new_f0 = 0;
new_nf = 1;
+ start_past_eof = true;
}
}
@@ -575,7 +577,10 @@
}
// read the new data from file
- if (_file->samplesPerFrame(_field) > 1) {
+ if (start_past_eof) {
+ _v[0] = NAN;
+ n_read = 1;
+ } else if (_file->samplesPerFrame(_field) > 1) {
assert(new_nf - NF - 1 > 0 || new_nf - NF - 1 == -1);
assert(new_f0 + NF >= 0);
assert(new_f0 + new_nf - 1 >= 0);
More information about the Kst
mailing list