Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

Domains: forum.doom9.org / forum.doom9.net / forum.doom9.se

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Development
Register FAQ Today's Posts Search

Reply
 
Thread Tools Search this Thread
Old 29th March 2004, 13:26   #1  |  Link
stickboy
AviSynth Enthusiast
 
Join Date: Jul 2002
Location: California, U.S.
Posts: 1,267
Fixes to the type matcher

I've been poking around in the AviSynth source to try to fix that pesky problem with *s in plug-in parameter strings. (For anyone not aware, for most cases the * modifier wasn't accepting zero matches. As a consequence, AviSynth didn't allow Animate/ApplyRange to be used with filters that take no arguments, nor did it allow SelectEvery(n) (which is supposed to be equivalent to SelectEvery(n, 0)).)

AFAICT, the following quick-fix seems to work:

In TypeMatch in avisynth.cpp, I changed:
Code:
return (   *param_types == 0 || *param_types == '[' 
        || *param_types == '+' || *param_types == '*');
to:
Code:
return    *param_types == '\0' || *param_types == '['
       || *param_types == '+' || param_types[0] == '*' || param_types[1] == '*';
Yeah, it seems like a hack; I haven't noticed any problems so far, but this is certainly the type of change that ought to undergo more scrutiny. Can anyone think of any cases this change might break?

I also modified AddFunction to check the correctness of filters' parameter strings.

TypeMatchTest.zip contains a modified avisynth.cpp (based on a version I checked out of CVS a few hours ago) along with a really basic command-line test harness for TypeMatch.

Last edited by stickboy; 29th March 2004 at 13:32.
stickboy is offline   Reply With Quote
Old 30th March 2004, 08:58   #2  |  Link
sh0dan
Retired AviSynth Dev ;)
 
sh0dan's Avatar
 
Join Date: Nov 2001
Location: Dark Side of the Moon
Posts: 3,480
Seems like a nice change. I'll add it to CVS.

Have you experienced any filters with invalid parameters?
__________________
Regards, sh0dan // VoxPod
sh0dan is offline   Reply With Quote
Old 30th March 2004, 09:40   #3  |  Link
stickboy
AviSynth Enthusiast
 
Join Date: Jul 2002
Location: California, U.S.
Posts: 1,267
Quote:
Originally posted by sh0dan
Have you experienced any filters with invalid parameters?
No, but I think it's useful:
  • It can simplify or eliminate error-checks in TypeMatch
  • I think there are some bogus parameter strings that could cause TypeMatch (and maybe other functions) to read beyond the end of the parameter string. There also are some that TypeMatch accepts (e.g. consecutive *s and +s) that potentially could cause less detectable problems.
  • Doesn't hurt.
stickboy is offline   Reply With Quote
Old 30th March 2004, 14:38   #4  |  Link
sh0dan
Retired AviSynth Dev ;)
 
sh0dan's Avatar
 
Join Date: Nov 2001
Location: Dark Side of the Moon
Posts: 3,480
Quote:
Doesn't hurt.
Actually it does.

I have ImageSequence.dll in my plugin dir, and it contains invalid parameters. Since vdubmod scans available plugins, this leads to a crash on every vdubmod startup.

Since it is not as carefully checked, vdubmod simply doesn't start up, but bombs out.

So no go. At least for default implementations.
__________________
Regards, sh0dan // VoxPod
sh0dan is offline   Reply With Quote
Old 30th March 2004, 16:03   #5  |  Link
WarpEnterprises
C64
 
WarpEnterprises's Avatar
 
Join Date: Apr 2002
Location: Austria
Posts: 830
why does IS not work and which version is causing this?
WarpEnterprises is offline   Reply With Quote
Old 30th March 2004, 21:53   #6  |  Link
stickboy
AviSynth Enthusiast
 
Join Date: Jul 2002
Location: California, U.S.
Posts: 1,267
Hmm... I just tried ImageSequence.dll from Imagesequence_25_dll_20030507.zip, and it seems to load fine for me. I don't see anything wrong with its parameter string either.
stickboy is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 19:58.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.