File tree 1 file changed +10
-2
lines changed
src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Imaging
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -1138,14 +1138,22 @@ out SafeFileHandle safeFilehandle
1138
1138
if ( stream is System . IO . FileStream )
1139
1139
{
1140
1140
System . IO . FileStream filestream = stream as System . IO . FileStream ;
1141
-
1142
1141
try
1143
1142
{
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
+ }
1145
1152
}
1146
1153
catch
1147
1154
{
1148
1155
// If Filestream doesn't support SafeHandle then revert to old code path.
1156
+ // See https://github.com/dotnet/wpf/issues/4355
1149
1157
safeFilehandle = null ;
1150
1158
}
1151
1159
}
You can’t perform that action at this time.
0 commit comments