Skip to content

Commit 800bd3f

Browse files
committed
Change assertion in fade tag to check durations rather than time values
Old behavior was to check if the 2nd and 3rd stops were positive, which makes no sense as negative time values are allowed in fade. Negative deltas, however, are not.
1 parent e04fef1 commit 800bd3f

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

l0/ASSFoundation/Tag/Fade.lua

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,11 @@ return function(ASS, ASSFInst, yutilsMissingMsg, createASSClass, re, util, unico
3030
return self.startDuration:getTagParams(coerce), self.endDuration:getTagParams(coerce)
3131
else
3232
local t1, t4 = self.startTime:getTagParams(coerce), self.endTime:getTagParams(coerce)
33-
local t2 = t1 + self.startDuration:getTagParams(coerce)
34-
local t3 = t4 - self.endDuration:getTagParams(coerce)
33+
local startDuration, endDuration = self.startDuration:getTagParams(coerce), self.endDuration:getTagParams(coerce)
34+
local t2 = t1 + startDuration
35+
local t3 = t4 - endDuration
3536
if not coerce then
36-
self:checkPositive(t2,t3)
37+
self:checkPositive(startDuration,endDuration)
3738
assertEx(t1<=t2 and t2<=t3 and t3<=t4, "fade times must evaluate to t1<=t2<=t3<=t4, got %d<=%d<=%d<=%d.",
3839
t1,t2,t3,t4)
3940
end
@@ -52,4 +53,4 @@ return function(ASS, ASSFInst, yutilsMissingMsg, createASSClass, re, util, unico
5253
end
5354

5455
return Fade
55-
end
56+
end

0 commit comments

Comments
 (0)