mirror of
https://github.com/mpv-player/mpv.git
synced 2024-09-20 12:02:23 +02:00
some possible buffer overflow places fixed
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@1097 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
ee6d3b42d1
commit
17a8a234ff
@ -231,7 +231,7 @@ while(fread(&objh,sizeof(objh),1,f)>0){
|
|||||||
#ifdef SAVE_STREAMS
|
#ifdef SAVE_STREAMS
|
||||||
if(!streams[sh->streamno&0x7F]){
|
if(!streams[sh->streamno&0x7F]){
|
||||||
char name[256];
|
char name[256];
|
||||||
sprintf(name,"stream%02X.dat",sh->streamno&0x7F);
|
snprintf(name,256,"stream%02X.dat",sh->streamno&0x7F);
|
||||||
streams[sh->streamno&0x7F]=fopen(name,"wb");
|
streams[sh->streamno&0x7F]=fopen(name,"wb");
|
||||||
}
|
}
|
||||||
fwrite(p,len,1,streams[sh->streamno&0x7F]);
|
fwrite(p,len,1,streams[sh->streamno&0x7F]);
|
||||||
|
@ -162,7 +162,7 @@ while(argc>1){
|
|||||||
printf("Converting %s...\n",argv[0]);
|
printf("Converting %s...\n",argv[0]);
|
||||||
if(pngRead(argv[0],&ize)) continue;
|
if(pngRead(argv[0],&ize)) continue;
|
||||||
if(ize.BPP!=8){ printf("Invalid BPP: %d\n",ize.BPP);continue;}
|
if(ize.BPP!=8){ printf("Invalid BPP: %d\n",ize.BPP);continue;}
|
||||||
sprintf(fname,"%s.raw",argv[0]);
|
snprintf(fname,256,"%s.raw",argv[0]);
|
||||||
f=fopen(fname,"wb");
|
f=fopen(fname,"wb");
|
||||||
rawhead[8]=ize.Width>>8;
|
rawhead[8]=ize.Width>>8;
|
||||||
rawhead[9]=ize.Width&255;
|
rawhead[9]=ize.Width&255;
|
||||||
|
@ -79,14 +79,14 @@ void DS_Filter::Create(char* dllname, const GUID* id, AM_MEDIA_TYPE* in_fmt, AM
|
|||||||
if (!m_iHandle)
|
if (!m_iHandle)
|
||||||
{
|
{
|
||||||
char e[1024];
|
char e[1024];
|
||||||
sprintf(e, "Could not open DirectShow DLL: %s", dllname);
|
snprintf(e, 1024, "Could not open DirectShow DLL: %s", dllname);
|
||||||
throw FATAL(e);
|
throw FATAL(e);
|
||||||
}
|
}
|
||||||
GETCLASS func=(GETCLASS)GetProcAddress(m_iHandle, "DllGetClassObject");
|
GETCLASS func=(GETCLASS)GetProcAddress(m_iHandle, "DllGetClassObject");
|
||||||
if (!func)
|
if (!func)
|
||||||
{
|
{
|
||||||
char e[1024];
|
char e[1024];
|
||||||
sprintf(e, "Illegal or corrupt DirectShow DLL: %s", dllname);
|
snprintf(e, 1024, "Illegal or corrupt DirectShow DLL: %s", dllname);
|
||||||
throw FATAL(e);
|
throw FATAL(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -121,7 +121,7 @@ ICOpen(long fccType,long fccHandler,unsigned int wMode) {
|
|||||||
memcpy(type,&fccType,4);type[4]=0;
|
memcpy(type,&fccType,4);type[4]=0;
|
||||||
memcpy(handler,&fccHandler,4);handler[4]=0;
|
memcpy(handler,&fccHandler,4);handler[4]=0;
|
||||||
|
|
||||||
sprintf(codecname,"%s.%s",type,handler);
|
snprintf(codecname,20,"%s.%s",type,handler);
|
||||||
|
|
||||||
/* Well, lParam2 is in fact a LPVIDEO_OPEN_PARMS, but it has the
|
/* Well, lParam2 is in fact a LPVIDEO_OPEN_PARMS, but it has the
|
||||||
* same layout as ICOPEN
|
* same layout as ICOPEN
|
||||||
@ -136,7 +136,7 @@ ICOpen(long fccType,long fccHandler,unsigned int wMode) {
|
|||||||
/*
|
/*
|
||||||
if (!hdrv) {
|
if (!hdrv) {
|
||||||
if (!strcasecmp(type,"vids")) {
|
if (!strcasecmp(type,"vids")) {
|
||||||
sprintf(codecname,"vidc.%s",handler);
|
snprintf(codecname,20,"vidc.%s",handler);
|
||||||
fccType = mmioFOURCC('v','i','d','c');
|
fccType = mmioFOURCC('v','i','d','c');
|
||||||
}
|
}
|
||||||
// hdrv=OpenDriverA(codecname,"drivers32",(long)&icopen);
|
// hdrv=OpenDriverA(codecname,"drivers32",(long)&icopen);
|
||||||
|
@ -771,7 +771,7 @@ void WINAPI expGetSystemInfo(SYSTEM_INFO* si)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* set the CPU type of the current processor */
|
/* set the CPU type of the current processor */
|
||||||
sprintf(buf,"CPU %ld",cachedsi.dwProcessorType);
|
snprintf(buf,20,"CPU %ld",cachedsi.dwProcessorType);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
/* old 2.0 method */
|
/* old 2.0 method */
|
||||||
@ -798,7 +798,7 @@ void WINAPI expGetSystemInfo(SYSTEM_INFO* si)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* set the CPU type of the current processor */
|
/* set the CPU type of the current processor */
|
||||||
sprintf(buf,"CPU %ld",cachedsi.dwProcessorType);
|
snprintf(buf,20,"CPU %ld",cachedsi.dwProcessorType);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!lstrncmpiA(line,"fdiv_bug",strlen("fdiv_bug"))) {
|
if (!lstrncmpiA(line,"fdiv_bug",strlen("fdiv_bug"))) {
|
||||||
@ -824,7 +824,7 @@ void WINAPI expGetSystemInfo(SYSTEM_INFO* si)
|
|||||||
/* Create a new processor subkey on a multiprocessor
|
/* Create a new processor subkey on a multiprocessor
|
||||||
* system
|
* system
|
||||||
*/
|
*/
|
||||||
sprintf(buf,"%d",x);
|
snprintf(buf,20,"%d",x);
|
||||||
}
|
}
|
||||||
if (!lstrncmpiA(line,"stepping",strlen("stepping"))) {
|
if (!lstrncmpiA(line,"stepping",strlen("stepping"))) {
|
||||||
int x;
|
int x;
|
||||||
|
Loading…
Reference in New Issue
Block a user