diff --git a/dlls/windowscodecs/propertybag.c b/dlls/windowscodecs/propertybag.c index 02914ec375a..11fa5b10abb 100644 --- a/dlls/windowscodecs/propertybag.c +++ b/dlls/windowscodecs/propertybag.c @@ -248,7 +248,7 @@ static HRESULT WINAPI PropertyBag_GetPropertyInfo(IPropertyBag2 *iface, ULONG iP if (iProperty+cProperties > This->prop_count ) return WINCODEC_ERR_VALUEOUTOFRANGE; - *pcProperties = max(cProperties, This->prop_count-iProperty); + *pcProperties = min(cProperties, This->prop_count-iProperty); for (i=0; i < *pcProperties; i++) {