Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
libcdi
Commits
f1c310e5
Commit
f1c310e5
authored
Jun 02, 2019
by
Uwe Schulzweida
Browse files
grb_read_raw_data: alloc gribbuffer with streamptr->record->buffersize.
parent
8dc0d5af
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/grb_read.c
View file @
f1c310e5
...
...
@@ -135,7 +135,7 @@ DecodeArgs grb_read_raw_data(stream_t *streamptr, int recID, int memtype, void *
if
(
recsize
==
0
)
Error
(
"Internal problem! Recordsize is zero for record %d at timestep %d"
,
recID
+
1
,
tsID
+
1
);
if
(
!
gribbuffer
)
gribbuffer
=
Malloc
(
rec
size
);
if
(
!
gribbuffer
)
gribbuffer
=
Malloc
(
streamptr
->
record
->
buffer
size
);
if
(
!
data
)
data
=
Malloc
(
gridsize
*
(
memtype
==
MEMTYPE_FLOAT
?
sizeof
(
float
)
:
sizeof
(
double
)));
if
(
resetFilePos
)
...
...
@@ -184,7 +184,7 @@ void JobDescriptor_startJob(JobDescriptor *me, stream_t *streamptr, int recID, i
static
void
JobDescriptor_finishJob
(
JobDescriptor
*
me
,
void
*
data
,
size_t
*
nmiss
)
{
if
(
AsyncWorker_wait
(
me
->
job
))
xabort
(
"error executing job in worker thread"
);
if
(
AsyncWorker_wait
(
me
->
job
))
xabort
(
"error executing job in worker thread"
);
memcpy
(
data
,
me
->
args
.
data
,
me
->
args
.
gridsize
*
(
me
->
args
.
memtype
==
MEMTYPE_FLOAT
?
sizeof
(
float
)
:
sizeof
(
double
)));
*
nmiss
=
me
->
args
.
nmiss
;
...
...
Write
Preview
Markdown
is supported
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