소스 검색

Backport pull request #8516 from jellyfin/release-10.8.z

fix: kill ffprobe if keyframe parsing fails

Original-merge: 6d23de64c093b83ba5a9c40d79b6362dd508fd62

Merged-by: Claus Vium <cvium@users.noreply.github.com>

Backported-by: Joshua M. Boniface <joshua@boniface.me>
cvium 2 년 전
부모
커밋
f6533e4228
1개의 변경된 파일21개의 추가작업 그리고 2개의 파일을 삭제
  1. 21 2
      src/Jellyfin.MediaEncoding.Keyframes/FfProbe/FfProbeKeyframeExtractor.cs

+ 21 - 2
src/Jellyfin.MediaEncoding.Keyframes/FfProbe/FfProbeKeyframeExtractor.cs

@@ -38,9 +38,28 @@ public static class FfProbeKeyframeExtractor
             EnableRaisingEvents = true
         };
 
-        process.Start();
+        try
+        {
+            process.Start();
 
-        return ParseStream(process.StandardOutput);
+            return ParseStream(process.StandardOutput);
+        }
+        catch (Exception)
+        {
+            try
+            {
+                if (!process.HasExited)
+                {
+                    process.Kill();
+                }
+            }
+            catch
+            {
+                // We do not care if this fails
+            }
+
+            throw;
+        }
     }
 
     internal static KeyframeData ParseStream(StreamReader reader)