summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Dufresne <nicolas.dufresne@collabora.com>2017-09-23 15:41:30 -0400
committerSebastian Dröge <sebastian@centricular.com>2017-10-19 15:59:00 +0200
commit233c50ae05afa7103a5c3127fcd1f549fde1e0dc (patch)
tree050ea8fa846c6f4edf661918214aa48794e35584
parent11a501e626dc4d246a20ae0659abb020dc8dd30b (diff)
downloadgstreamer-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.c5
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) {