mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
mpegvideoparse: fix crash if downstream is unliked
mpeg_packetizer_get_block() in some circumstances (here: if downstream was unlinked) returns a block but does not set the buffer causing mpegvideoparse_drain_avail() to cause invalid memory access. Fixes #619502.
This commit is contained in:
parent
c6e77c3d03
commit
721643431e
2 changed files with 6 additions and 1 deletions
|
@ -412,6 +412,11 @@ mpeg_packetiser_get_block (MPEGPacketiser * p, GstBuffer ** buf)
|
||||||
p->adapter_offset += block->length;
|
p->adapter_offset += block->length;
|
||||||
|
|
||||||
GST_BUFFER_TIMESTAMP (*buf) = block->ts;
|
GST_BUFFER_TIMESTAMP (*buf) = block->ts;
|
||||||
|
} else {
|
||||||
|
GST_DEBUG ("we have a block but do not meet all conditions buf: %p "
|
||||||
|
"block length: %d adapter offset %" G_GUINT64_FORMAT " block offset "
|
||||||
|
"%" G_GUINT64_FORMAT, buf, block->length, p->adapter_offset,
|
||||||
|
block->offset);
|
||||||
}
|
}
|
||||||
return block;
|
return block;
|
||||||
}
|
}
|
||||||
|
|
|
@ -493,7 +493,7 @@ mpegvideoparse_drain_avail (MpegVideoParse * mpegvideoparse)
|
||||||
cur->length, picture_start_code_name (cur->first_pack_type),
|
cur->length, picture_start_code_name (cur->first_pack_type),
|
||||||
cur->flags);
|
cur->flags);
|
||||||
|
|
||||||
if (cur->flags & MPEG_BLOCK_FLAG_SEQUENCE) {
|
if ((cur->flags & MPEG_BLOCK_FLAG_SEQUENCE) && buf != NULL) {
|
||||||
/* Found a sequence header */
|
/* Found a sequence header */
|
||||||
if (!mpegvideoparse_handle_sequence (mpegvideoparse, buf)) {
|
if (!mpegvideoparse_handle_sequence (mpegvideoparse, buf)) {
|
||||||
GST_DEBUG_OBJECT (mpegvideoparse,
|
GST_DEBUG_OBJECT (mpegvideoparse,
|
||||||
|
|
Loading…
Reference in a new issue