Thread: Avisynth+
View Single Post
Old 20th January 2019, 01:50   #4401  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Fixed, sorry.

If size specifier is wrong then gets only first four bytes (half of __int64 start, bytes 0 to 3) from stack for vsprintf start arg,
vsprintf count would come from 2nd half (4 bytes, bytes 4 to 7) of start, so count on stack would NOT be accessed at all.

EDIT: for other readers, the vsprintf mentioned stuff, think Wonkey is using something like this

Code:
    int __cdecl dprintf(char* fmt, ...) {
        char printString[2048]="WonkeyWilly: ";                         // Must be nul Termed, eg "Test: " or ""
        char *p=printString;
        for(;*p++;);
        --p;                                                            // @ null term
        va_list argp;
        va_start(argp, fmt);
        vsprintf(p, fmt, argp);
        va_end(argp);
        for(;*p++;);
        --p;                                                            // @ null term
        if(printString == p || p[-1] != '\n') {
            p[0]='\n';                                                  // append n/l if not there already
            p[1]='\0';
        }
        OutputDebugString(printString);
        return int(p-printString);                                      // strlen printString
    }
EDIT:
Quote:
Originally Posted by wonkey_monkey View Post
This is my GetAudio:

Code:
void __stdcall tracker::GetAudio(void* buffer, __int64 start, __int64 count, IScriptEnvironment* env) {
	debug("GetAudio: %d,%d", start, count);
	if (start == -0x5452414b) {
		switch (count) {
			case 0: {
				*((int*)buffer) = 0x5452414b;
			} break;
		}
	} else {
		child->GetAudio(buffer, start, count, env);
	}
}
and this is my call to GetAudio, in the constructor of another filter:

Code:
		int check = 0;
		child->GetAudio(&check, 0x5452414b, 0, env);
		debug("%d", check);
Not sure that I'm understandin' the -ve value in red [0x5452414b = 'TRAK'].
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 20th January 2019 at 19:29.
StainlessS is offline