Subversion Repositories filter_foundry

Rev

Rev 308 | Rev 339 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 308 Rev 309
Line 188... Line 188...
188
 
188
 
189
        if(FSpOpenDF(&sfr->sfFile,fsRdPerm,&refnum) == noErr){
189
        if(FSpOpenDF(&sfr->sfFile,fsRdPerm,&refnum) == noErr){
190
                // check DOS EXE magic number
190
                // check DOS EXE magic number
191
                count = 2;
191
                count = 2;
192
                if(FSRead(refnum,&count,magic) == noErr /*&& magic[0]=='M' && magic[1]=='Z'*/){
192
                if(FSRead(refnum,&count,magic) == noErr /*&& magic[0]=='M' && magic[1]=='Z'*/){
193
                        if(GetEOF(refnum,(FILEPOS*)&count) == noErr && count < 8192L<<10){ // sanity check file size < 8MiB (note that "Debug" builds can have approx 700 KiB while "Release" builds have approx 300 KiB) The 32/64 bit mixer triples the size.
193
                        if(GetEOF(refnum,(FILEPOS*)&count) == noErr && count < 4096L<<10){ // sanity check file size < 4MiB (note that "Debug" builds can have approx 700 KiB while "Release" builds have approx 300 KiB)
194
                                if( (h = readfileintohandle(refnum)) ){
194
                                if( (h = readfileintohandle(refnum)) ){
195
                                        long *q = (long*)PILOCKHANDLE(h,false);
195
                                        long *q = (long*)PILOCKHANDLE(h,false);
196
 
196
 
197
                                        // look for signature at start of valid PARM resource
197
                                        // look for signature at start of valid PARM resource
198
                                        // This signature is observed in Filter Factory standalones.
198
                                        // This signature is observed in Filter Factory standalones.