Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
libcdi
Commits
579d6752
Commit
579d6752
authored
Feb 15, 2016
by
Uwe Schulzweida
Browse files
input-freeze-fix.patch from Nathanael
parent
5ac93df3
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/iterator_grib.c
View file @
579d6752
...
...
@@ -236,7 +236,7 @@ static ssize_t scanToGribMarker(CdiGribIterator *me)
if
(
scannedBytes
+
scanSize
>
kMaxScanSize
)
scanSize
=
kMaxScanSize
-
scannedBytes
;
assert
(
scanSize
<=
me
->
bufferSize
);
int
status
=
cdiInputFile_read
(
me
->
file
,
me
->
fileOffset
+
(
off_t
)
scannedBytes
,
scanSize
,
&
scanSize
,
me
->
gribBuffer
);
if
(
status
!=
CDI_NOERR
&&
status
!=
CDI_EEOF
)
return
status
;
if
(
status
!=
CDI_NOERR
&&
status
!=
CDI_EEOF
)
return
-
1
;
const
unsigned
char
*
startPosition
=
positionOfGribMarker
(
me
->
gribBuffer
,
scanSize
);
if
(
startPosition
)
...
...
@@ -246,8 +246,8 @@ static ssize_t scanToGribMarker(CdiGribIterator *me)
//Get the offset for the next iteration if there is a next iteration.
scanSize
-=
3
;
//so that we won't miss a 'GRIB' sequence that happens to be cut off
scan
nedBytes
+=
scanSize
;
scannedBytes
&=
~
(
size_t
)
0xf
;
//make 16 bytes aligned
scan
Size
&=
~
(
size_t
)
0xf
;
//make 16 bytes aligned
if
((
ssize_t
)
scanSize
<=
0
)
return
-
1
;
//ensure that we make progress
}
return
-
1
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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