diff options
author | Owen Taylor <otaylor@redhat.com> | 2001-12-18 17:34:23 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2001-12-18 17:34:23 +0000 |
commit | b94d0634798ad6f70dfda610c26b3621ae02dc21 (patch) | |
tree | 53e37ab314b96d1a795e46d859f44a9b62c254cd /modules/indic | |
parent | 01b5c66858b8253c62b51760aef8ba1c8ad18e64 (diff) | |
download | pango-b94d0634798ad6f70dfda610c26b3621ae02dc21.tar.gz |
Syllable array needs to start at length 2, not 1. Also, some cleanups.
Tue Dec 18 12:33:03 2001 Owen Taylor <otaylor@redhat.com>
* modules/indic/*-x.c (pango_engine_shape): Syllable
array needs to start at length 2, not 1. Also, some
cleanups. (Memory overrun reported by Joshua Pritikin
#66850)
Diffstat (limited to 'modules/indic')
-rw-r--r-- | modules/indic/bengali-x.c | 4 | ||||
-rw-r--r-- | modules/indic/devanagari-x.c | 4 | ||||
-rw-r--r-- | modules/indic/gujarati-x.c | 4 | ||||
-rw-r--r-- | modules/indic/gurmukhi-x.c | 4 | ||||
-rw-r--r-- | modules/indic/myanmar-x.c | 4 |
5 files changed, 10 insertions, 10 deletions
diff --git a/modules/indic/bengali-x.c b/modules/indic/bengali-x.c index fd815a79..ee66c9a0 100644 --- a/modules/indic/bengali-x.c +++ b/modules/indic/bengali-x.c @@ -211,7 +211,7 @@ pango_indic_engine_shape (PangoFont * font, gunichar *wc; int sb; int n_syls; - gunichar **syls = g_malloc (sizeof (gunichar **)); + gunichar **syls = g_new (gunichar *, 2); g_return_if_fail (font != NULL); g_return_if_fail (text != NULL); g_return_if_fail (length >= 0); @@ -239,7 +239,7 @@ pango_indic_engine_shape (PangoFont * font, if (i && (is_consonant (wc[i]) | is_ind_vowel (wc[i])) && wc[i - 1] != VIRAMA) { - syls = g_realloc (syls, ((n_syls + 2) * sizeof (gunichar **))); + syls = g_renew (gunichar *, syls, n_syls + 2); syls[n_syls] = wc + i; n_syls++; sb = glyphs->log_clusters[i]; diff --git a/modules/indic/devanagari-x.c b/modules/indic/devanagari-x.c index 0082109f..ec8012e3 100644 --- a/modules/indic/devanagari-x.c +++ b/modules/indic/devanagari-x.c @@ -253,7 +253,7 @@ pango_indic_engine_shape (PangoFont * font, gunichar *wc; int sb; int n_syls; - gunichar **syls = g_malloc (sizeof (gunichar **)); + gunichar **syls = g_new (gunichar *, 2); g_return_if_fail (font != NULL); g_return_if_fail (text != NULL); @@ -282,7 +282,7 @@ pango_indic_engine_shape (PangoFont * font, if (i && (is_consonant (wc[i]) | is_ind_vowel (wc[i])) && wc[i - 1] != VIRAMA) { - syls = g_realloc (syls, ((n_syls + 2) * sizeof (gunichar **))); + syls = g_renew (gunichar *, syls, n_syls + 2); syls[n_syls] = wc + i; n_syls++; sb = glyphs->log_clusters[i]; diff --git a/modules/indic/gujarati-x.c b/modules/indic/gujarati-x.c index 47599b55..1a998b88 100644 --- a/modules/indic/gujarati-x.c +++ b/modules/indic/gujarati-x.c @@ -236,7 +236,7 @@ pango_indic_engine_shape (PangoFont * font, gunichar *wc; int sb; int n_syls; - gunichar **syls = g_malloc (sizeof (gunichar **)); + gunichar **syls = g_new (gunichar *, 2); g_return_if_fail (font != NULL); g_return_if_fail (text != NULL); @@ -263,7 +263,7 @@ pango_indic_engine_shape (PangoFont * font, if (i && (is_consonant (wc[i]) | is_ind_vowel (wc[i])) && wc[i - 1] != VIRAMA) { - syls = g_realloc (syls, ((n_syls + 2) * sizeof (gunichar **))); + syls = g_renew (gunichar *, syls, n_syls + 2); syls[n_syls] = wc + i; n_syls++; sb = glyphs->log_clusters[i]; diff --git a/modules/indic/gurmukhi-x.c b/modules/indic/gurmukhi-x.c index f810e648..89ae5e69 100644 --- a/modules/indic/gurmukhi-x.c +++ b/modules/indic/gurmukhi-x.c @@ -156,7 +156,7 @@ pango_indic_engine_shape (PangoFont * font, gunichar *wc; int sb; int n_syls; - gunichar **syls = g_malloc (sizeof (gunichar **)); + gunichar **syls = g_new (gunichar *, 2); g_return_if_fail (font != NULL); g_return_if_fail (text != NULL); @@ -183,7 +183,7 @@ pango_indic_engine_shape (PangoFont * font, if (i && (is_consonant (wc[i]) | is_ind_vowel (wc[i])) && wc[i - 1] != VIRAMA) { - syls = g_realloc (syls, ((n_syls + 2) * sizeof (gunichar **))); + syls = g_renew (gunichar *, syls, n_syls + 2); syls[n_syls] = wc + i; n_syls++; sb = glyphs->log_clusters[i]; diff --git a/modules/indic/myanmar-x.c b/modules/indic/myanmar-x.c index bf6378b6..140e2026 100644 --- a/modules/indic/myanmar-x.c +++ b/modules/indic/myanmar-x.c @@ -134,7 +134,7 @@ pango_engine_shape (PangoFont * font, gunichar *wc; int sb; int n_syls; - gunichar **syls = g_malloc (sizeof (gunichar **)); + gunichar **syls = g_new (gunichar *, 2); g_return_if_fail (font != NULL); g_return_if_fail (text != NULL); @@ -161,7 +161,7 @@ pango_engine_shape (PangoFont * font, if (i && (is_consonant (wc[i]) | is_ind_vowel (wc[i])) && wc[i - 1] != VIRAMA) { - syls = g_realloc (syls, ((n_syls + 2) * sizeof (gunichar **))); + syls = g_renew (gunichar *, syls, n_syls + 2); syls[n_syls] = wc + i; n_syls++; sb = glyphs->log_clusters[i]; |