Skip to content

Commit

Permalink
qint64 problems
Browse files Browse the repository at this point in the history
  • Loading branch information
AjayLimaye committed Mar 6, 2018
1 parent d4bbfa2 commit db672f9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions tools/import/plugins/raw/rawplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@ RawPlugin::setFile(QStringList files)
else if (m_voxelType == _Int) bpv = 4;
else if (m_voxelType == _Float) bpv = 4;

if (fin.size() == 13+nX*nY*nZ*bpv)
if (fin.size() == 13+(qint64)nX*(qint64)nY*(qint64)nZ*(qint64)bpv)
m_skipBytes = 13;
else if (fin.size() == 12+nX*nY*nZ*bpv)
else if (fin.size() == 12+(qint64)nX*(qint64)nY*(qint64)nZ*(qint64)bpv)
m_skipBytes = 12;
else
m_skipBytes = 0;
Expand Down
6 changes: 3 additions & 3 deletions tools/import/plugins/rawslabs/rawslabsplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ void
RawSlabsPlugin::getDepthSlice(int slc,
uchar *slice)
{
int nbytes = m_width*m_height*m_bytesPerVoxel;
qint64 nbytes = m_width*m_height*m_bytesPerVoxel;
if (slc < 0 || slc >= m_depth)
{
memset(slice, 0, nbytes);
Expand Down Expand Up @@ -683,8 +683,8 @@ RawSlabsPlugin::getWidthSlice(int slc,
int slcno = ((fno > 0) ? k-m_slices[fno-1] : k);

fin.seek((qint64)(m_skipBytes +
(slcno*m_width*m_height +
slc*m_height)*m_bytesPerVoxel));
((qint64)slcno*m_width*m_height +
(qint64)slc*m_height)*m_bytesPerVoxel));
fin.read((char*)(slice+(qint64)(k*m_height*m_bytesPerVoxel)),
(qint64)(m_height*m_bytesPerVoxel));
}
Expand Down

0 comments on commit db672f9

Please sign in to comment.