Commit fde2277f authored by Derk-Jan Hartman's avatar 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
parent 573844a9
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment