[Swfdec] 2 commits - libswfdec/swfdec_bits.c
Benjamin Otte
company at kemper.freedesktop.org
Tue May 1 07:36:44 PDT 2007
libswfdec/swfdec_bits.c | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
New commits:
diff-tree ee9dd4ff79d598316c0e97222ef3aac8be4688e7 (from parents)
Merge: d9f0775f1390a4af3ca7a8c81717dc0b83ae0b51 936eabe443ef788a6444a1077ae571b7731b5e67
Author: Benjamin Otte <otte at gnome.org>
Date: Tue May 1 16:37:43 2007 +0200
Merge branch 'master' of ssh://company@git.freedesktop.org/git/swfdec
diff-tree d9f0775f1390a4af3ca7a8c81717dc0b83ae0b51 (from 158cee244eb9faa5c818d41b3e06a20bfbd0cbce)
Author: Benjamin Otte <otte at gnome.org>
Date: Tue May 1 16:36:50 2007 +0200
don't compute a size < (unsigned) 0
if n_gradients was 0, that could happen
diff --git a/libswfdec/swfdec_bits.c b/libswfdec/swfdec_bits.c
index b74846e..c8a5062 100644
--- a/libswfdec/swfdec_bits.c
+++ b/libswfdec/swfdec_bits.c
@@ -587,7 +587,7 @@ swfdec_bits_get_gradient (SwfdecBits * b
n_gradients = swfdec_bits_get_u8 (bits);
grad = g_malloc (sizeof (SwfdecGradient) +
- sizeof (SwfdecGradientEntry) * (n_gradients - 1));
+ sizeof (SwfdecGradientEntry) * (MAX (n_gradients, 1) - 1));
for (i = 0; i < n_gradients && swfdec_bits_left (bits); i++) {
grad->array[i].ratio = swfdec_bits_get_u8 (bits);
grad->array[i].color = swfdec_bits_get_color (bits);
More information about the Swfdec
mailing list