Commit 64d6c3c8 authored by ElenaSubbotina's avatar ElenaSubbotina

.

parent 9e639ec6
...@@ -195,6 +195,9 @@ static const struct ActionNamesEmf ...@@ -195,6 +195,9 @@ static const struct ActionNamesEmf
m_oStream >> ulType; m_oStream >> ulType;
m_oStream >> ulSize; m_oStream >> ulSize;
if (ulSize < 1)
continue;
m_ulRecordPos = m_oStream.Tell(); m_ulRecordPos = m_oStream.Tell();
m_ulRecordSize = ulSize - 8; m_ulRecordSize = ulSize - 8;
...@@ -1074,7 +1077,7 @@ static const struct ActionNamesEmf ...@@ -1074,7 +1077,7 @@ static const struct ActionNamesEmf
m_oStream.Skip(4); // offBits m_oStream.Skip(4); // offBits
m_oStream.Skip(4); // cbBits m_oStream.Skip(4); // cbBits
m_ulRecordSize -= 20; unsigned int current_size = m_ulRecordSize - 20;
CEmfLogPen* pPen = new CEmfLogPen(); CEmfLogPen* pPen = new CEmfLogPen();
if (!pPen) if (!pPen)
...@@ -1088,10 +1091,10 @@ static const struct ActionNamesEmf ...@@ -1088,10 +1091,10 @@ static const struct ActionNamesEmf
m_oStream.Skip(4); // BrushHatch m_oStream.Skip(4); // BrushHatch
m_oStream >> pPen->NumStyleEntries; m_oStream >> pPen->NumStyleEntries;
m_ulRecordSize -= 24; current_size -= 24;
if (pPen->NumStyleEntries > 0) if (pPen->NumStyleEntries > 0)
{ {
m_ulRecordSize -= pPen->NumStyleEntries * 4; current_size -= pPen->NumStyleEntries * 4;
pPen->StyleEntry = new unsigned int[pPen->NumStyleEntries]; pPen->StyleEntry = new unsigned int[pPen->NumStyleEntries];
if (!pPen->StyleEntry) if (!pPen->StyleEntry)
{ {
...@@ -1110,7 +1113,7 @@ static const struct ActionNamesEmf ...@@ -1110,7 +1113,7 @@ static const struct ActionNamesEmf
} }
// Пропускаем часть с картинкой, если она была // Пропускаем часть с картинкой, если она была
m_oStream.Skip(m_ulRecordSize); m_oStream.Skip(current_size);
m_oPlayer.RegisterObject(ulPenIndex, (CEmfObjectBase*)pPen); m_oPlayer.RegisterObject(ulPenIndex, (CEmfObjectBase*)pPen);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment