Skip to content

Commit

Permalink
Avoid potential division by zero
Browse files Browse the repository at this point in the history
  • Loading branch information
tbeu committed Jun 24, 2019
1 parent 1907695 commit fabac6c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mat5.c
Original file line number Diff line number Diff line change
Expand Up @@ -1322,7 +1322,7 @@ ReadNextStructField( mat_t *mat, matvar_t *matvar )
(void)Mat_uint32Swap(buf);
(void)Mat_uint32Swap(buf+1);
}
if ( (buf[0] & 0x0000ffff) == MAT_T_INT32 ) {
if ( (buf[0] & 0x0000ffff) == MAT_T_INT32 && buf[1] > 0 ) {
fieldname_size = buf[1];
} else {
Mat_Critical("Error getting fieldname size");
Expand Down

0 comments on commit fabac6c

Please sign in to comment.