Browse Source

Don't decode animated images

Cody Robibero 1 năm trước cách đây
mục cha
commit
86b77de522
1 tập tin đã thay đổi với 5 bổ sung0 xóa
  1. 5 0
      src/Jellyfin.Drawing.Skia/SkiaEncoder.cs

+ 5 - 0
src/Jellyfin.Drawing.Skia/SkiaEncoder.cs

@@ -262,6 +262,11 @@ public class SkiaEncoder : IImageEncoder
                 return null;
             }
 
+            if (codec.FrameCount != 0)
+            {
+                throw new ArgumentException("Cannot decode images with multiple frames");
+            }
+
             // create the bitmap
             var bitmap = new SKBitmap(codec.Info.Width, codec.Info.Height, !requiresTransparencyHack);