mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 14:26:43 +00:00
qtdemux: Check for data size when parsing h264 codec data from strf atom
This commit is contained in:
parent
722ef42196
commit
47ed79fb1c
1 changed files with 10 additions and 7 deletions
|
@ -7357,15 +7357,18 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak)
|
|||
* are the fourcc, next 40 bytes are BITMAPINFOHEADER,
|
||||
* next 1 byte is the version, and the
|
||||
* subsequent bytes are sequence parameter set like data. */
|
||||
gst_codec_utils_h264_caps_set_level_and_profile (stream->caps,
|
||||
avc_data + 8 + 40 + 1, size - 1);
|
||||
|
||||
buf = gst_buffer_new_and_alloc (size);
|
||||
gst_buffer_fill (buf, 0, avc_data + 8 + 40, size);
|
||||
gst_caps_set_simple (stream->caps,
|
||||
"codec_data", GST_TYPE_BUFFER, buf, NULL);
|
||||
gst_buffer_unref (buf);
|
||||
size -= 40; /* we'll be skipping BITMAPINFOHEADER */
|
||||
if (size > 1) {
|
||||
gst_codec_utils_h264_caps_set_level_and_profile (stream->caps,
|
||||
avc_data + 8 + 40 + 1, size - 1);
|
||||
|
||||
buf = gst_buffer_new_and_alloc (size);
|
||||
gst_buffer_fill (buf, 0, avc_data + 8 + 40, size);
|
||||
gst_caps_set_simple (stream->caps,
|
||||
"codec_data", GST_TYPE_BUFFER, buf, NULL);
|
||||
gst_buffer_unref (buf);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case FOURCC_btrt:
|
||||
|
|
Loading…
Reference in a new issue