[MPlayer-dev-eng] patch fixing FPE in vo_mga
root
ragamuffin at datacomm.ch
Sun Mar 30 12:24:35 CEST 2003
--- libvo/mga_common.c~ Sat Mar 29 17:45:56 2003
+++ libvo/mga_common.c Sun Mar 30 10:02:39 2003
@@ -27,7 +27,8 @@
static void draw_alpha(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){
uint32_t bespitch = (mga_vid_config.src_width + 31) & ~31;
- x0+=mga_vid_config.src_width*(vo_panscan_x>>1)/(vo_dwidth+vo_panscan_x);
+ if ((dwidth + vo_panscan_x) > 0)
+ x0+=mga_vid_config.src_width*(vo_panscan_x>>1)/(vo_dwidth+vo_panscan_x);
switch(mga_vid_config.format){
case MGA_VID_FORMAT_YV12:
case MGA_VID_FORMAT_IYUV:
@@ -45,7 +46,12 @@
static void draw_osd(void)
{
- vo_draw_text(mga_vid_config.src_width-mga_vid_config.src_width*vo_panscan_x/(vo_dwidth+vo_panscan_x),mga_vid_config.src_height,draw_alpha);
+ int width = mga_vid_config.src_width;
+
+ if ((dwidth + vo_panscan_x) > 0)
+ width-=mga_vid_config.src_width*vo_panscan_x/(vo_dwidth+vo_panscan_x);
+
+ vo_draw_text(width,mga_vid_config.src_height,draw_alpha);
}
More information about the MPlayer-dev-eng
mailing list