Skip to content

Commit

Permalink
Check for read error
Browse files Browse the repository at this point in the history
  • Loading branch information
detomon committed May 11, 2024
1 parent 075174d commit 1e00c35
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/BKData.c
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,10 @@ BKInt BKDataLoadRaw(BKData* data, FILE* file, BKUInt numChannels, BKEnum params)
}

fseek(file, offset, SEEK_SET);
fread(frames, sizeof(char), size, file);

if (fread(frames, sizeof(char), size, file) < size) {
return BK_FILE_ERROR;
}

BKInt ret = BKDataSetData(data, frames, (BKUInt)size, numChannels, params);

Expand Down

0 comments on commit 1e00c35

Please sign in to comment.