Skip to content

Commit 83935b1

Browse files
committed
libmatroska2: always initialize the lace FrameSize
It's used to skip the data no matter what.
1 parent 3e8b1d6 commit 83935b1

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

libmatroska2/matroskamain.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1206,11 +1206,11 @@ err_t MATROSKA_BlockReadData(matroska_block *Element, struct stream *Input, int
12061206
size_t Offset = 0;
12071207
for (NumFrame=0;Err==ERR_NONE && NumFrame<ARRAYCOUNT(Element->SizeList,int32_t);++NumFrame)
12081208
{
1209+
FrameSize = ARRAYBEGIN(Element->SizeList,int32_t)[NumFrame];
12091210
#if defined(CONFIG_ZLIB)
12101211
if (EBML_IntegerValue((ebml_integer*)Header)==MATROSKA_TRACK_ENCODING_COMP_ZLIB)
12111212
{
12121213
size_t UncompressedSize;
1213-
FrameSize = ARRAYBEGIN(Element->SizeList,int32_t)[NumFrame];
12141214
Err = UnCompressFrameZLib(InBuf, FrameSize, &Element->Data, &UncompressedSize, &Offset);
12151215
if (Err == ERR_NONE)
12161216
{
@@ -1227,12 +1227,11 @@ err_t MATROSKA_BlockReadData(matroska_block *Element, struct stream *Input, int
12271227
else
12281228
{
12291229
lzo_uint outSize = max(2048, ARRAYBEGIN(Element->SizeList,int32_t)[NumFrame] << 2);
1230-
FrameSize = ARRAYBEGIN(Element->SizeList,int32_t)[NumFrame];
12311230
if (!ArrayResize(&Element->Data, OutSize + outSize, 0))
12321231
Err = ERR_OUT_OF_MEMORY;
12331232
else
12341233
{
1235-
if (lzo1x_decompress_safe(InBuf, ARRAYBEGIN(Element->SizeList,int32_t)[NumFrame], ARRAYBEGIN(Element->Data,uint8_t) + OutSize, &outSize, NULL) != LZO_E_OK)
1234+
if (lzo1x_decompress_safe(InBuf, FrameSize, ARRAYBEGIN(Element->Data,uint8_t) + OutSize, &outSize, NULL) != LZO_E_OK)
12361235
Err = ERR_INVALID_DATA;
12371236
else
12381237
{
@@ -1257,7 +1256,7 @@ err_t MATROSKA_BlockReadData(matroska_block *Element, struct stream *Input, int
12571256
{
12581257
size_t Count;
12591258
stream.next_in = (char*)InBuf;
1260-
stream.avail_in = FrameSize = ARRAYBEGIN(Element->SizeList,int32_t)[NumFrame];
1259+
stream.avail_in = FrameSize;
12611260
stream.next_out = ARRAYBEGIN(Element->Data,char) + OutSize;
12621261
do {
12631262
Count = stream.next_out - ARRAYBEGIN(Element->Data,char);

0 commit comments

Comments
 (0)