Browse Source

添加 边界判断

jsonwang 3 years ago
parent
commit
b6d815d88c

+ 7 - 3
BFFramework/Classes/Stuckpoint/Controller/PQStuckPointEditerController.swift

@@ -1404,12 +1404,16 @@ extension PQStuckPointEditerController {
 
                             // 3,多补一个卡点 做 C级 速处理
                             if useAssestDurationTemp < assetDuration {
+                                
                                 lastPointIndex = sticker.clipCount % stuckPointsTemp.count
                                 let a = stuckPointsTemp[lastPointIndex ?? 0]
-                                let b = stuckPointsTemp[(lastPointIndex ?? 0) + 1]
-                                finallyStuckPoints.append((finallyStuckPoints.last ?? 0.0) + (b - a))
+                                if((lastPointIndex ?? 0) + 1 < stuckPointsTemp.count){
+                                    let b = stuckPointsTemp[(lastPointIndex ?? 0) + 1]
+                                    finallyStuckPoints.append((finallyStuckPoints.last ?? 0.0) + (b - a))
 
-                                sticker.clipCount = sticker.clipCount + 1
+                                    sticker.clipCount = sticker.clipCount + 1
+                                }
+                               
                             }
                         }
                     }