Commit f477d545 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

STL: correctly ignore user-data comments

Ref #10910 and FABst comments
parent 65393c1b
......@@ -119,12 +119,20 @@ static subpicture_t *Decode(decoder_t *dec, block_t **block)
if (b->i_buffer < 128)
goto exit;
int payload_size = (b->i_buffer / 128) * 112;
uint8_t *payload = malloc(payload_size);
int payload_size = 0;
uint8_t *payload = malloc((b->i_buffer / 128) * 112);
if (!payload)
goto exit;
/* */
int j = 0;
for (unsigned i = 0; i < b->i_buffer / 128; i++)
memcpy(&payload[112 * i], &b->p_buffer[128 * i + 16], 112);
{
if( b->p_buffer[128 * i + 3] != 0xfe ) {
memcpy(&payload[112 * j++], &b->p_buffer[128 * i + 16], 112);
payload_size += 112;
}
}
sub = decoder_NewSubpicture(dec, NULL);
if (!sub) {
......
......@@ -135,12 +135,13 @@ static int Demux(demux_t *demux)
{
demux_sys_t *sys = demux->p_sys;
int prev_index = 0;
while(sys->current < sys->count) {
stl_entry_t *s = &sys->index[sys->current];
if (s->start > sys->next_date)
break;
block_t *b = vlc_stream_Block(demux->s, 128 * s->count);
block_t *b = vlc_stream_Block(demux->s, 128 * (s->index - prev_index ));
if (b) {
b->i_dts =
b->i_pts = VLC_TS_0 + s->start;
......@@ -149,6 +150,7 @@ static int Demux(demux_t *demux)
es_out_Send(demux->out, sys->es, b);
}
sys->current++;
prev_index = s->index;
}
return sys->current < sys->count ? 1 : 0;
}
......
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