You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
wfurt commentedon Jul 19, 2021
should we transfer this to runtime @safern?
safern commentedon Jul 19, 2021
Yes. I'll transfer it and since it is a regression I will mark it as 6.0.0
safern commentedon Jul 19, 2021
@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:
runtime/src/libraries/System.Drawing.Common/src/System/Drawing/ImageInfo.cs
Line 164 in 57bfe47
@AngeloCresta could you share a zip with a GIF and a Program.cs that causes the exception?
AngeloCresta commentedon Jul 20, 2021
This is a sample project with the control that uses the animated gif causing the error.
WinFormsApp1.zip
jeffhandley commentedon Jul 20, 2021
Thank you, @AngeloCresta! I'll get this fixed in 6.0 RC1.