[vlc-devel] commit: libass: avoid crash on ASS_Images which have width or height == 0 ( Grigori Goronzy )
git version control
git at videolan.org
Tue Jan 12 01:36:49 CET 2010
vlc-1.0-bugfix | branch: master | Grigori Goronzy <greg at chown.ath.cx> | Tue Jan 12 01:29:54 2010 +0100| [277c61c394262eac36218d000a303d77ad91403e] | committer: Jean-Baptiste Kempf
libass: avoid crash on ASS_Images which have width or height == 0
(cherry picked from commit 1a974cea523b6fcc055f4bb35e66c9fbcd3a713d)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc-1.0-bugfix.git/?a=commit;h=277c61c394262eac36218d000a303d77ad91403e
---
modules/codec/libass.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/modules/codec/libass.c b/modules/codec/libass.c
index 019359b..4a33621 100644
--- a/modules/codec/libass.c
+++ b/modules/codec/libass.c
@@ -471,7 +471,8 @@ static int BuildRegions( spu_t *p_spu, rectangle_t *p_region, int i_max_region,
#endif
for( p_tmp = p_img_list, i_count = 0; p_tmp != NULL; p_tmp = p_tmp->next )
- i_count++;
+ if( p_tmp->w > 0 && p_tmp->h > 0 )
+ i_count++;
if( i_count <= 0 )
return 0;
@@ -479,8 +480,9 @@ static int BuildRegions( spu_t *p_spu, rectangle_t *p_region, int i_max_region,
if( !pp_img )
return 0;
- for( p_tmp = p_img_list, i_count = 0; p_tmp != NULL; p_tmp = p_tmp->next, i_count++ )
- pp_img[i_count] = p_tmp;
+ for( p_tmp = p_img_list, i_count = 0; p_tmp != NULL; p_tmp = p_tmp->next )
+ if( p_tmp->w > 0 && p_tmp->h > 0 )
+ pp_img[i_count++] = p_tmp;
/* */
const int i_w_inc = __MAX( ( i_width + 49 ) / 50, 32 );
More information about the vlc-devel
mailing list