Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libmatroska2: always initialize the lace FrameSize #184

Merged
merged 1 commit into from
Dec 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions libmatroska2/matroskamain.c
Original file line number Diff line number Diff line change
Expand Up @@ -1206,11 +1206,11 @@ err_t MATROSKA_BlockReadData(matroska_block *Element, struct stream *Input, int
size_t Offset = 0;
for (NumFrame=0;Err==ERR_NONE && NumFrame<ARRAYCOUNT(Element->SizeList,int32_t);++NumFrame)
{
FrameSize = ARRAYBEGIN(Element->SizeList,int32_t)[NumFrame];
#if defined(CONFIG_ZLIB)
if (EBML_IntegerValue((ebml_integer*)Header)==MATROSKA_TRACK_ENCODING_COMP_ZLIB)
{
size_t UncompressedSize;
FrameSize = ARRAYBEGIN(Element->SizeList,int32_t)[NumFrame];
Err = UnCompressFrameZLib(InBuf, FrameSize, &Element->Data, &UncompressedSize, &Offset);
if (Err == ERR_NONE)
{
Expand All @@ -1227,12 +1227,11 @@ err_t MATROSKA_BlockReadData(matroska_block *Element, struct stream *Input, int
else
{
lzo_uint outSize = max(2048, ARRAYBEGIN(Element->SizeList,int32_t)[NumFrame] << 2);
FrameSize = ARRAYBEGIN(Element->SizeList,int32_t)[NumFrame];
if (!ArrayResize(&Element->Data, OutSize + outSize, 0))
Err = ERR_OUT_OF_MEMORY;
else
{
if (lzo1x_decompress_safe(InBuf, ARRAYBEGIN(Element->SizeList,int32_t)[NumFrame], ARRAYBEGIN(Element->Data,uint8_t) + OutSize, &outSize, NULL) != LZO_E_OK)
if (lzo1x_decompress_safe(InBuf, FrameSize, ARRAYBEGIN(Element->Data,uint8_t) + OutSize, &outSize, NULL) != LZO_E_OK)
Err = ERR_INVALID_DATA;
else
{
Expand All @@ -1257,7 +1256,7 @@ err_t MATROSKA_BlockReadData(matroska_block *Element, struct stream *Input, int
{
size_t Count;
stream.next_in = (char*)InBuf;
stream.avail_in = FrameSize = ARRAYBEGIN(Element->SizeList,int32_t)[NumFrame];
stream.avail_in = FrameSize;
stream.next_out = ARRAYBEGIN(Element->Data,char) + OutSize;
do {
Count = stream.next_out - ARRAYBEGIN(Element->Data,char);
Expand Down
Loading