mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-28 20:51:13 +00:00
typefind: Use unchecked byte reader methods where possible
The size is checked before, so we can use them.
This commit is contained in:
parent
c5d7bb8918
commit
05a778b1c4
1 changed files with 4 additions and 4 deletions
|
@ -235,18 +235,18 @@ check_utf16 (const guint8 * data, gint len, gint endianness)
|
||||||
while (len >= 2) {
|
while (len >= 2) {
|
||||||
/* test first for a single 16 bit value in the BMP */
|
/* test first for a single 16 bit value in the BMP */
|
||||||
if (endianness == G_BIG_ENDIAN)
|
if (endianness == G_BIG_ENDIAN)
|
||||||
gst_byte_reader_get_uint16_be (&br, &high);
|
high = gst_byte_reader_get_uint16_be_unchecked (&br);
|
||||||
else
|
else
|
||||||
gst_byte_reader_get_uint16_le (&br, &high);
|
high = gst_byte_reader_get_uint16_le_unchecked (&br);
|
||||||
if (high >= 0xD800 && high <= 0xDBFF) {
|
if (high >= 0xD800 && high <= 0xDBFF) {
|
||||||
/* start of a surrogate pair */
|
/* start of a surrogate pair */
|
||||||
if (len < 4)
|
if (len < 4)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
len -= 2;
|
len -= 2;
|
||||||
if (endianness == G_BIG_ENDIAN)
|
if (endianness == G_BIG_ENDIAN)
|
||||||
gst_byte_reader_get_uint16_be (&br, &low);
|
low = gst_byte_reader_get_uint16_be_unchecked (&br);
|
||||||
else
|
else
|
||||||
gst_byte_reader_get_uint16_le (&br, &low);
|
low = gst_byte_reader_get_uint16_le_unchecked (&br);
|
||||||
if (low >= 0xDC00 && low <= 0xDFFF) {
|
if (low >= 0xDC00 && low <= 0xDFFF) {
|
||||||
/* second half of the surrogate pair */
|
/* second half of the surrogate pair */
|
||||||
} else
|
} else
|
||||||
|
|
Loading…
Reference in a new issue