Commit f1c310e5 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

grb_read_raw_data: alloc gribbuffer with streamptr->record->buffersize.

parent 8dc0d5af
......@@ -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(recsize);
if (!gribbuffer) gribbuffer = Malloc(streamptr->record->buffersize);
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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment