diff options
author | Nicolas Dufresne <nicolas.dufresne@collabora.com> | 2017-09-23 15:41:30 -0400 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2017-10-19 15:59:00 +0200 |
commit | 233c50ae05afa7103a5c3127fcd1f549fde1e0dc (patch) | |
tree | 050ea8fa846c6f4edf661918214aa48794e35584 | |
parent | 11a501e626dc4d246a20ae0659abb020dc8dd30b (diff) | |
download | gstreamer-plugins-good-233c50ae05afa7103a5c3127fcd1f549fde1e0dc.tar.gz |
flvdemux: Ignore invalid H.264 codec data
This code basically skip over codec_data with empty payload. In
this case, the codec_data variable is the size of the header for
the CODEC part of Video Tag. The remaining is supposed to be the
H.264 codec data, hence should not be empty.
https://bugzilla.gnome.org/show_bug.cgi?id=787795
-rw-r--r-- | gst/flv/gstflvdemux.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gst/flv/gstflvdemux.c b/gst/flv/gstflvdemux.c index 8a25d5f4d..2a0fa45ae 100644 --- a/gst/flv/gstflvdemux.c +++ b/gst/flv/gstflvdemux.c @@ -1522,6 +1522,11 @@ gst_flv_demux_parse_tag_video (GstFlvDemux * demux, GstBuffer * buffer) switch (avc_packet_type) { case 0: { + if (demux->tag_data_size < codec_data) { + GST_ERROR_OBJECT (demux, "Got invalid H.264 codec, ignoring."); + break; + } + /* AVCDecoderConfigurationRecord data */ GST_LOG_OBJECT (demux, "got an H.264 codec data packet"); if (demux->video_codec_data) { |