[Mplayer-cvslog] CVS: main/libmpcodecs vd_realvid.c,1.22,1.23

Alex Beregszaszi alex at mplayerhq.hu
Mon May 12 18:02:58 CEST 2003


Update of /cvsroot/mplayer/main/libmpcodecs
In directory mail:/var/tmp.root/cvs-serv17795

Modified Files:
	vd_realvid.c 
Log Message:
dynamic path[] allocation

Index: vd_realvid.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vd_realvid.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- vd_realvid.c	11 May 2003 17:58:03 -0000	1.22
+++ vd_realvid.c	12 May 2003 16:02:34 -0000	1.23
@@ -191,7 +191,7 @@
 // init driver
 static int init(sh_video_t *sh){
 	//unsigned int out_fmt;
-	char path[4096];
+	char *path;
 	int result;
 	// we export codec id and sub-id from demuxer in bitmapinfohdr:
 	unsigned int* extrahdr=(unsigned int*)(sh->bih+1);
@@ -201,6 +201,8 @@
 
 	mp_msg(MSGT_DECVIDEO,MSGL_V,"realvideo codec id: 0x%08X  sub-id: 0x%08X\n",extrahdr[1],extrahdr[0]);
 
+	path = malloc(strlen(REALCODEC_PATH)+strlen(sh->codec->dll)+2);
+	if (!path) return 0;
 	sprintf(path, REALCODEC_PATH "/%s", sh->codec->dll);
 
 	/* first try to load linux dlls, if failed and we're supporting win32 dlls,
@@ -214,8 +216,10 @@
 	{
 		mp_msg(MSGT_DECVIDEO,MSGL_ERR,MSGTR_MissingDLLcodec,sh->codec->dll);
 		mp_msg(MSGT_DECVIDEO,MSGL_HINT,"Read the RealVideo section of the DOCS!\n");
+		free(path);
 		return 0;
 	}
+	free(path);
 	// only I420 supported
 //	if((sh->format!=0x30335652) && !mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_I420)) return 0;
 	// init codec:



More information about the MPlayer-cvslog mailing list