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
This commit is contained in:
Nicolas Dufresne 2017-09-23 15:41:30 -04:00
parent 18dbd49fb8
commit cfc1638ca5

View file

@ -1520,6 +1520,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) {