mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 14:25:27 +00:00
Fix crash with converted DM5 log
If DM4 log file is converted to DM5, the sampleBlob is empty. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
8f224c1737
commit
5adc3d2cfd
1 changed files with 1 additions and 1 deletions
|
@ -2082,7 +2082,7 @@ extern int dm5_dive(void *param, int columns, char **data, char **column)
|
|||
|
||||
interval = data[16] ? atoi(data[16]) : 0;
|
||||
sampleBlob = (unsigned const char *)data[17];
|
||||
for (i = 0; interval && i * interval < cur_dive->duration.seconds; i++) {
|
||||
for (i = 0; interval && sampleBlob && i * interval < cur_dive->duration.seconds; i++) {
|
||||
float *depth = (float *)&sampleBlob[i * 16 + 3];
|
||||
int32_t temp = (sampleBlob[i * 16 + 10] << 8) + sampleBlob[i * 16 + 11];
|
||||
int32_t pressure = (sampleBlob[i * 16 + 9] << 16) + (sampleBlob[i * 16 + 8] << 8) + sampleBlob[i * 16 + 7];
|
||||
|
|
Loading…
Add table
Reference in a new issue