[MPlayer-dev-eng] [PATCH] some bugs in the osd menu

Christian Ohm chr.ohm at gmx.net
Tue Dec 24 02:43:52 CET 2002


hi.

i've found some bugs in the osd menu. and some i was even able to fix :).
the attached patch contains those i'm pretty sure about.

but there are some more, like open_dir sometimes being called with a NULL as
args, and the file list getting corrupted on its way to menu_list_draw, so
m->txt in line 49 of menu_list.c points to some random garbage. both result
in a segfault.

i haven't found the cause of that yet, i'll see if i can hunt them down if i
have some time.

bye,
christian ohm

ps: i've attached a simplified version of my aspect correction plugin.

-- 
If the human brain were so simple that we could understand it,
we would be so simple we couldn't.
-------------- next part --------------
Index: libmenu/menu_filesel.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmenu/menu_filesel.c,v
retrieving revision 1.4
diff -u -r1.4 menu_filesel.c
--- libmenu/menu_filesel.c	4 Dec 2002 23:41:04 -0000	1.4
+++ libmenu/menu_filesel.c	24 Dec 2002 01:27:52 -0000
@@ -92,7 +92,7 @@
 
 static int mylstat(char *dir, char *file,struct stat* st) {
   int l = strlen(dir) + strlen(file);
-  char s[l+1];
+  char s[l+2];
   sprintf(s,"%s/%s",dir,file);
   return lstat(s,st);
 }
@@ -175,11 +178,13 @@
   }
   while(n--) {
     e = calloc(1,sizeof(list_entry_t));
+    e->p.next = NULL;
     e->p.txt = strdup(namelist[n]);
     if(strchr(namelist[n], '/') != NULL)
       e->d = 1;
     menu_list_add_entry(menu,e);
     free(namelist[n]);
+    free(e);
   }
   free(namelist);
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vf_aspectcorrection.c
Type: text/x-csrc
Size: 834 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20021224/6fad5eae/attachment.c>
-------------- next part --------------
Index: libmpcodecs/Makefile
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/Makefile,v
retrieving revision 1.82
diff -u -r1.82 Makefile
--- libmpcodecs/Makefile	16 Dec 2002 01:49:39 -0000	1.82
+++ libmpcodecs/Makefile	24 Dec 2002 01:27:53 -0000
@@ -14,7 +14,7 @@
 VIDEO_SRCS_OPT=vd_realvid.c vd_ffmpeg.c vd_dshow.c vd_dmo.c vd_vfw.c vd_vfwex.c vd_odivx.c vd_divx4.c vd_xanim.c vd_xvid.c vd_libdv.c vd_qtvideo.c
 VIDEO_SRCS=dec_video.c vd.c $(VIDEO_SRCS_NAT) $(VIDEO_SRCS_LIB) $(VIDEO_SRCS_OPT)
 
-VFILTER_SRCS=vf.c vf_vo.c vf_crop.c vf_expand.c vf_pp.c vf_scale.c vf_format.c vf_yuy2.c vf_flip.c vf_rgb2bgr.c vf_rotate.c vf_mirror.c vf_palette.c vf_lavc.c vf_dvbscale.c vf_cropdetect.c vf_test.c vf_noise.c vf_yvu9.c vf_rectangle.c vf_lavcdeint.c vf_eq.c vf_eq2.c vf_halfpack.c vf_dint.c vf_1bpp.c vf_bmovl.c vf_2xsai.c vf_unsharp.c vf_swapuv.c vf_il.c vf_boxblur.c vf_sab.c vf_smartblur.c vf_perspective.c
+VFILTER_SRCS=vf.c vf_vo.c vf_crop.c vf_expand.c vf_pp.c vf_scale.c vf_format.c vf_yuy2.c vf_flip.c vf_rgb2bgr.c vf_rotate.c vf_mirror.c vf_palette.c vf_lavc.c vf_dvbscale.c vf_cropdetect.c vf_test.c vf_noise.c vf_yvu9.c vf_rectangle.c vf_lavcdeint.c vf_eq.c vf_eq2.c vf_halfpack.c vf_dint.c vf_1bpp.c vf_bmovl.c vf_2xsai.c vf_unsharp.c vf_swapuv.c vf_il.c vf_boxblur.c vf_sab.c vf_smartblur.c vf_perspective.c vf_aspectcorrection.c
 ENCODER_SRCS=ve.c ve_divx4.c ve_lavc.c ve_vfw.c ve_rawrgb.c ve_libdv.c ve_xvid.c ve_qtvideo.c
 
 NATIVE_SRCS=native/RTjpegN.c native/cinepak.c native/cyuv.c native/fli.c native/minilzo.c native/msvidc.c native/nuppelvideo.c native/qtrle.c native/qtrpza.c native/qtsmc.c native/roqav.c native/xa_gsm.c native/svq1.c
Index: libmpcodecs/vf.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vf.c,v
retrieving revision 1.63
diff -u -r1.63 vf.c
--- libmpcodecs/vf.c	5 Dec 2002 00:22:37 -0000	1.63
+++ libmpcodecs/vf.c	24 Dec 2002 01:27:55 -0000
@@ -52,6 +52,7 @@
 extern vf_info_t vf_info_sab;
 extern vf_info_t vf_info_smartblur;
 extern vf_info_t vf_info_perspective;
+extern vf_info_t vf_info_aspectcorrection;
 
 char** vo_plugin_args=(char**) NULL;
 
@@ -97,6 +98,7 @@
     &vf_info_sab,
     &vf_info_smartblur,
     &vf_info_perspective,
+    &vf_info_aspectcorrection,
     NULL
 };
 


More information about the MPlayer-dev-eng mailing list