Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
LEFEBVREJP email
radix
Commits
b3857c82
Commit
b3857c82
authored
Nov 18, 2019
by
LEFEBVREJP email
Browse files
Merge branch 'spectrum_array_fix' into 'master'
Update array indices to prevent out of bounds. See merge request
!88
parents
472f1d3e
1130911d
Pipeline
#80468
passed with stages
in 21 minutes and 18 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
radixio/spectrumpcfstream.i.hh
View file @
b3857c82
...
...
@@ -119,14 +119,14 @@ bool SpectrumPCFStream<data_type>::read_from(const std::string &file)
<<
" bytes to beginning of pairs (@512 bytes)"
);
stream
.
skipBytes
(
512
-
stream
.
bytesRead
());
for
(
size_t
column
=
0
;
column
<
2
;
++
column
)
for
(
size_t
column
=
0
;
column
<
2
0
;
++
column
)
{
radix
(
" "
);
for
(
size_t
panel
=
0
;
panel
<
8
;
++
panel
)
{
for
(
size_t
mca
=
0
;
mca
<
8
;
++
mca
)
{
for
(
size_t
pair
=
0
;
pair
<
2
0
;
++
pair
)
for
(
size_t
pair
=
0
;
pair
<
2
;
++
pair
)
{
float
energy
=
stream
.
readFloat
();
float
offset
=
stream
.
readFloat
();
...
...
@@ -148,14 +148,14 @@ bool SpectrumPCFStream<data_type>::read_from(const std::string &file)
// Read compressed deviation pairs
// Move to beginning of pairs
stream
.
skipBytes
(
226
);
for
(
size_t
column
=
0
;
column
<
4
;
++
column
)
for
(
size_t
column
=
0
;
column
<
20
;
++
column
)
{
radix
(
" "
);
for
(
size_t
panel
=
0
;
panel
<
8
;
++
panel
)
{
for
(
size_t
mca
=
0
;
mca
<
8
;
++
mca
)
{
for
(
size_t
pair
=
0
;
pair
<
20
;
++
pair
)
for
(
size_t
pair
=
0
;
pair
<
4
;
++
pair
)
{
float
energy
=
float
(
stream
.
readShort
())
/
10.
f
;
float
offset
=
float
(
stream
.
readShort
())
/
10.
f
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment