Skip to content

Commit

Permalink
Same as #846 for Xiph lacing.
Browse files Browse the repository at this point in the history
  • Loading branch information
jcdr428 committed May 10, 2024
1 parent 2e8bb29 commit 1185947
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tsMuxer/matroskaDemuxer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,16 @@ int MatroskaDemuxer::matroska_parse_block(uint8_t *data, int size, const int64_t
}
total += lace_size[n];
}
lace_size[n] = size - total;
if (total > size)
{
LTRACE(LT_INFO, 0, "EBML block data error");
break;
}

// if more than one frame in the lace,
// size of last frame is remaining size
if (laces > 1)
lace_size[n] = size - total;
break;
}

Expand Down Expand Up @@ -603,7 +612,7 @@ int MatroskaDemuxer::matroska_parse_block(uint8_t *data, int size, const int64_t
total += lace_size[n];
}
// if more than one frame in the lace,
// remaining size is size of last frame
// size of last frame is remaining size
if (laces > 1)
lace_size[n] = size - total;

Expand Down

0 comments on commit 1185947

Please sign in to comment.