mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
qtdemux: Fix comparision for extra caption atom
We want to make sure we have *enough* data for the potential 2nd caption atom. CID #1434161
This commit is contained in:
parent
8213fc2edf
commit
2662f58cc9
1 changed files with 4 additions and 1 deletions
|
@ -5427,6 +5427,7 @@ extract_cc_from_data (QtDemuxStream * stream, const guint8 * data, gsize size,
|
||||||
GST_FOURCC_ARGS (fourcc));
|
GST_FOURCC_ARGS (fourcc));
|
||||||
goto invalid_cdat;
|
goto invalid_cdat;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Convert to cc_data triplet */
|
/* Convert to cc_data triplet */
|
||||||
if (fourcc == FOURCC_cdat)
|
if (fourcc == FOURCC_cdat)
|
||||||
cdat = convert_to_ccdata (data + 8, atom_length - 8, 1, &cdat_size);
|
cdat = convert_to_ccdata (data + 8, atom_length - 8, 1, &cdat_size);
|
||||||
|
@ -5434,10 +5435,11 @@ extract_cc_from_data (QtDemuxStream * stream, const guint8 * data, gsize size,
|
||||||
cdt2 = convert_to_ccdata (data + 8, atom_length - 8, 2, &cdt2_size);
|
cdt2 = convert_to_ccdata (data + 8, atom_length - 8, 2, &cdt2_size);
|
||||||
GST_DEBUG_OBJECT (stream->pad, "size:%" G_GSIZE_FORMAT " atom_length:%u",
|
GST_DEBUG_OBJECT (stream->pad, "size:%" G_GSIZE_FORMAT " atom_length:%u",
|
||||||
size, atom_length);
|
size, atom_length);
|
||||||
|
|
||||||
/* Check for another atom ? */
|
/* Check for another atom ? */
|
||||||
if (size > atom_length + 8) {
|
if (size > atom_length + 8) {
|
||||||
guint32 new_atom_length = QT_UINT32 (data + atom_length);
|
guint32 new_atom_length = QT_UINT32 (data + atom_length);
|
||||||
if (size <= atom_length + new_atom_length) {
|
if (size >= atom_length + new_atom_length) {
|
||||||
fourcc = QT_FOURCC (data + atom_length + 4);
|
fourcc = QT_FOURCC (data + atom_length + 4);
|
||||||
if (fourcc == FOURCC_cdat) {
|
if (fourcc == FOURCC_cdat) {
|
||||||
if (cdat == NULL)
|
if (cdat == NULL)
|
||||||
|
@ -5458,6 +5460,7 @@ extract_cc_from_data (QtDemuxStream * stream, const guint8 * data, gsize size,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
*cclen = cdat_size + cdt2_size;
|
*cclen = cdat_size + cdt2_size;
|
||||||
res = g_malloc (*cclen);
|
res = g_malloc (*cclen);
|
||||||
if (cdat_size)
|
if (cdat_size)
|
||||||
|
|
Loading…
Reference in a new issue