If a delta happens to have zero objects, we could end up doing
a divide-by-zero when inferring endianness. In practice,
a zero-object delta isn't possible to generate I think, but
let's make sure the code is defensive all the same.
Spotted by Coverity.
Coverity CID:
1452208
Closes: #1041
Approved by: pwithnall
* deltas, period. Past the gigabyte scale you really want
* bittorrent or something.
*/
- if ((total_size / total_objects) > G_MAXUINT32)
+ if (total_objects > 0 && (total_size / total_objects) > G_MAXUINT32)
{
is_byteswapped = TRUE;
}