mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-29 18:48:44 +00:00
lang: fix possible array overrun
We where checking for i<G_N_ELEMENTS, but where accessing i+1.
This commit is contained in:
parent
f514be993c
commit
9b8992cbf1
1 changed files with 1 additions and 1 deletions
|
@ -411,7 +411,7 @@ gst_tag_get_language_code_iso_639_2X (const gchar * lang_code, guint8 flags)
|
|||
} else if (i > 0 && (iso_639_codes[i - 1].flags & flags) == flags &&
|
||||
iso_639_codes[i].name_offset == iso_639_codes[i - 1].name_offset) {
|
||||
return iso_639_codes[i - 1].iso_639_2;
|
||||
} else if (i < G_N_ELEMENTS (iso_639_codes) &&
|
||||
} else if ((i + 1) < G_N_ELEMENTS (iso_639_codes) &&
|
||||
(iso_639_codes[i + 1].flags & flags) == flags &&
|
||||
iso_639_codes[i].name_offset == iso_639_codes[i + 1].name_offset) {
|
||||
return iso_639_codes[i + 1].iso_639_2;
|
||||
|
|
Loading…
Reference in a new issue