mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
qtdemux: Handle bogus caption samples
Corrupted files could potentially have multiple cdat/cdt2 atoms in a sample entry, which is unclear how to handle. Ignore repeated ones. CID #1434162 CID #1434159
This commit is contained in:
parent
21eb9b49be
commit
8213fc2edf
1 changed files with 17 additions and 8 deletions
|
@ -5439,14 +5439,23 @@ extract_cc_from_data (QtDemuxStream * stream, const guint8 * data, gsize size,
|
||||||
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) {
|
||||||
cdat =
|
if (cdat == NULL)
|
||||||
convert_to_ccdata (data + atom_length + 8, new_atom_length - 8,
|
cdat =
|
||||||
1, &cdat_size);
|
convert_to_ccdata (data + atom_length + 8,
|
||||||
else
|
new_atom_length - 8, 1, &cdat_size);
|
||||||
cdt2 =
|
else
|
||||||
convert_to_ccdata (data + atom_length + 8, new_atom_length - 8,
|
GST_WARNING_OBJECT (stream->pad,
|
||||||
2, &cdt2_size);
|
"Got multiple [cdat] atoms in a c608 sample. This is unsupported for now. Please file a bug");
|
||||||
|
} else {
|
||||||
|
if (cdt2 == NULL)
|
||||||
|
cdt2 =
|
||||||
|
convert_to_ccdata (data + atom_length + 8,
|
||||||
|
new_atom_length - 8, 2, &cdt2_size);
|
||||||
|
else
|
||||||
|
GST_WARNING_OBJECT (stream->pad,
|
||||||
|
"Got multiple [cdt2] atoms in a c608 sample. This is unsupported for now. Please file a bug");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*cclen = cdat_size + cdt2_size;
|
*cclen = cdat_size + cdt2_size;
|
||||||
|
|
Loading…
Reference in a new issue