Skip to content

Animated Gif - division by zero #55972

Closed

Description

@AngeloCresta

Description

Binding an animated gif to a picture box will cause a division by zero error

configuration

VS 2022 P2,. Net Core 6 preview 6 on Windows 10 21H1 (x64)

Regression?

Worked on. Net 5

Other information - Stack Trace

CoreCLR Version: 6.0.21.35212
.NET Version: 6.0.0-preview.6.21352.12
Description: The process was terminated due to an unhandled exception.
Exception Info: System.DivideByZeroException: Attempted to divide by zero.
at System.Math.DivRem(Int64 a, Int64 b, Int64& result) in System.Private.CoreLib.dll:token 0x600046a+0x0
at System.Drawing.ImageAnimator.ImageInfo.AdvanceAnimationBy(Int64 milliseconds) in System.Drawing.Common.dll:token 0x6000bed+0x31
at System.Drawing.ImageAnimator.AnimateImages() in System.Drawing.Common.dll:token 0x60002e0+0x3d
at System.Threading.Thread.StartHelper.Callback(Object state) in System.Private.CoreLib.dll:token 0x600288d+0x0
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in System.Private.CoreLib.dll:token 0x6002a2d+0x40
--- End of stack trace from previous location ---
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in System.Private.CoreLib.dll:token 0x6002a2d+0x80
at System.Threading.Thread.StartCallback() in System.Private.CoreLib.dll:token 0x600280f+0xe

Activity

  1. wfurt commented on Jul 19, 2021

    @wfurt
    Member

    should we transfer this to runtime @safern?

  2. safern commented on Jul 19, 2021

    @safern
    Member

    Yes. I'll transfer it and since it is a regression I will mark it as 6.0.0

  3. transferred this issue fromdotnet/coreon Jul 19, 2021
  4. ghost added
    untriaged
    on Jul 19, 2021
  5. removed
    untriaged
    on Jul 19, 2021
  6. added this to the 6.0.0 milestone on Jul 19, 2021
  7. safern commented on Jul 19, 2021

    @safern
    Member

    @jeffhandley this seems like a regression from: 3ffc4fc#diff-b932d2f5042c51d85e4441810d14e37dd2f7dbecf05237075aed420a4b6e7663

    It looks like the timeElapsed is 0 in here? 3ffc4fc#diff-b932d2f5042c51d85e4441810d14e37dd2f7dbecf05237075aed420a4b6e7663R408

    Hitting the exception in:

    _loop += (short)Math.DivRem(_frameTimer, TotalAnimationTime, out long newTimer);

    @AngeloCresta could you share a zip with a GIF and a Program.cs that causes the exception?

  8. self-assigned this
    on Jul 19, 2021
  9. AngeloCresta commented on Jul 20, 2021

    @AngeloCresta
    Author

    This is a sample project with the control that uses the animated gif causing the error.
    WinFormsApp1.zip

  10. jeffhandley commented on Jul 20, 2021

    @jeffhandley
    Member

    Thank you, @AngeloCresta! I'll get this fixed in 6.0 RC1.

  11. ghost added
    in-pr
    on Jul 23, 2021
  12. ghost removed
    in-pr
    on Jul 24, 2021
  13. ghost locked as resolved and limited conversation to collaborators on Aug 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions