summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-04-13 18:16:50 +0200
committerwm4 <wm4@nowhere>2013-04-20 23:28:22 +0200
commit4b562bdf208feb637a05f688fa39c8cf3be41fda (patch)
tree9b30e692d4e2ee90149311c6b178a003ad8f97b7
parent6ef855069f057322a2fb19a51024a750e6a04f0f (diff)
downloadmpv-4b562bdf208feb637a05f688fa39c8cf3be41fda.tar.bz2
mpv-4b562bdf208feb637a05f688fa39c8cf3be41fda.tar.xz
demux_mkv: there can be 256 laces
The lace number is stored with an offset of 1, so the maximum number of laces is 255+1=256.
-rw-r--r--demux/demux_mkv.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/demux/demux_mkv.c b/demux/demux_mkv.c
index 387779ddc8..bc66ceaaf7 100644
--- a/demux/demux_mkv.c
+++ b/demux/demux_mkv.c
@@ -1795,11 +1795,11 @@ static bool bstr_read_u8(bstr *buffer, uint8_t *out_u8)
}
}
-static int demux_mkv_read_block_lacing(bstr *buffer, uint8_t *laces,
+static int demux_mkv_read_block_lacing(bstr *buffer, int *laces,
uint32_t lace_size[MAX_NUM_LACES])
{
uint32_t total = 0;
- uint8_t flags;
+ uint8_t flags, t;
int i;
/* lacing flags */
@@ -1815,14 +1815,13 @@ static int demux_mkv_read_block_lacing(bstr *buffer, uint8_t *laces,
case 1: /* xiph lacing */
case 2: /* fixed-size lacing */
case 3: /* EBML lacing */
- if (!bstr_read_u8(buffer, laces))
+ if (!bstr_read_u8(buffer, &t))
goto error;
- (*laces)++;
+ *laces = t + 1;
switch ((flags & 0x06) >> 1) {
case 1: /* xiph lacing */
for (i = 0; i < *laces - 1; i++) {
- uint8_t t;
lace_size[i] = 0;
do {
if (!bstr_read_u8(buffer, &t))
@@ -2134,7 +2133,7 @@ static int handle_block(demuxer_t *demuxer, struct block_info *block_info)
{
mkv_demuxer_t *mkv_d = (mkv_demuxer_t *) demuxer->priv;
demux_stream_t *ds = NULL;
- uint8_t laces;
+ int laces;
int i, use_this_block = 1;
double current_pts;
bstr data = block_info->data;