File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Imaging Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -1138,14 +1138,22 @@ out SafeFileHandle safeFilehandle
11381138 if ( stream is System . IO . FileStream )
11391139 {
11401140 System . IO . FileStream filestream = stream as System . IO . FileStream ;
1141-
11421141 try
11431142 {
1144- safeFilehandle = filestream . SafeFileHandle ;
1143+ if ( filestream . IsAsync is false )
1144+ {
1145+ safeFilehandle = filestream . SafeFileHandle ;
1146+ }
1147+ else
1148+ {
1149+ // The IWICImagingFactory_CreateDecoderFromFileHandle_Proxy do not support async Filestream, so we revert to old code path.
1150+ safeFilehandle = null ;
1151+ }
11451152 }
11461153 catch
11471154 {
11481155 // If Filestream doesn't support SafeHandle then revert to old code path.
1156+ // See https://github.com/dotnet/wpf/issues/4355
11491157 safeFilehandle = null ;
11501158 }
11511159 }
You can’t perform that action at this time.
0 commit comments