[vlc-devel] commit: rotate filter: Avoid a crash (Derk-Jan Hartman )
git version control
git at videolan.org
Mon Jun 22 21:03:42 CEST 2009
vlc | branch: master | Derk-Jan Hartman <hartman at videolan.org> | Mon Jun 22 20:52:53 2009 +0200| [fde2277f8f994c60b60372db98061ab1b72af3f3] | committer: Derk-Jan Hartman
rotate filter: Avoid a crash
This fixes a DIVIDEBYZERO crash in the rotate filter. Does not seem like the right solution to me, but dionoea should probably look into that, since he wrote most of this filter.
This crash occured with http://streams.videolan.org/issues/HIGNFY%20S25E02%20-%20Part%201.flv
plane 1 (non Y-plane)
i_visible_lines = 119
p_pic->p[Y_PLANE].i_visible_pitch = 320
p_pic->p[Y_PLANE].i_visible_lines = 239
i_visible_pitch = 160
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=fde2277f8f994c60b60372db98061ab1b72af3f3
---
modules/video_filter/rotate.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/modules/video_filter/rotate.c b/modules/video_filter/rotate.c
index 8a1d434..642e8d0 100644
--- a/modules/video_filter/rotate.c
+++ b/modules/video_filter/rotate.c
@@ -194,7 +194,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
const int i_pitch = p_pic->p[i_plane].i_pitch;
const int i_hidden_pitch = i_pitch - i_visible_pitch;
- const int i_aspect = ( i_visible_lines * p_pic->p[Y_PLANE].i_visible_pitch ) / ( p_pic->p[Y_PLANE].i_visible_lines * i_visible_pitch );
+ const int i_aspect = __MAX( 1, ( i_visible_lines * p_pic->p[Y_PLANE].i_visible_pitch ) / ( p_pic->p[Y_PLANE].i_visible_lines * i_visible_pitch ));
/* = 2 for U and V planes in YUV 4:2:2, = 1 otherwise */
const int i_line_center = i_visible_lines>>1;
More information about the vlc-devel
mailing list