Fix Icon(Stream) handling of partial reads (#82621)
authorStephen Toub <stoub@microsoft.com>
Thu, 2 Mar 2023 17:04:28 +0000 (12:04 -0500)
committerGitHub <noreply@github.com>
Thu, 2 Mar 2023 17:04:28 +0000 (12:04 -0500)
commitbac3bef8c4f504806b7ce79790c59a5fb1ee1675
tree1152bb7a32591bfbf6e9161e89cf1abb8f995119
parentb61bdb9c012602c913f8d02b1ac4dd8d62c93cd4
Fix Icon(Stream) handling of partial reads (#82621)

Icon's ctor assumes Read on a stream will always produce as much data as was asked for, and that's not guaranteed to be the case.
src/libraries/System.Drawing.Common/src/System/Drawing/Icon.cs
src/libraries/System.Drawing.Common/tests/IconTests.cs