ImageConvolutionKernel asserts on Windows because it's trying to read and write from the same image at the same time which is no longer allowed

    // If this is hit, there's already another BitmapData or Graphics context active on this
    // image. Only one BitmapData or Graphics context may be active on an Image at a time.
    jassert (state != State::drawing);
    const Image::BitmapData destData (destImage, area.getX(), area.getY(), area.getWidth(), area.getHeight(),
                                      Image::BitmapData::writeOnly);
    uint8* line = destData.data;

    const Image::BitmapData srcData (sourceImage, Image::BitmapData::readOnly);

The above isn’t legal anymore if destImage == sourceImage. In that case you should make only one Image::BitmapData that has read / write access.

Code to reproduce:

//==============================================================================
void MainComponent::paint (juce::Graphics& g)
{
    // (Our component is opaque, so we must completely fill the background with a solid colour)
    g.fillAll (getLookAndFeel().findColour (juce::ResizableWindow::backgroundColourId));

	int w = getWidth();
	int h = getHeight();

	juce::Image blurredImage (juce::Image::ARGB, w, h, true);

	{
		juce::Graphics gi (blurredImage);
		gi.fillAll (juce::Colours::blue);

		gi.setColour (juce::Colours::red);
		gi.drawRect (w/4, h/4, w/2, h/2, 5);
	}

	juce::ImageConvolutionKernel blur (12);
	blur.createGaussianBlur (6);

	blur.applyToImage (blurredImage, blurredImage, blurredImage.getBounds());

	g.drawImageAt (blurredImage, 0, 0);
}

I’m also seeing this same assert due to the source and destination imsage being the same.
The comments for ImageConvolutionKernel::applyToImage(…) state they can be the same image!

Note this only happens on Windows and not MacOS.

/** Applies the kernel to an image.

        @param destImage        the image that will receive the resultant convoluted pixels.
        @param sourceImage      the source image to read from - this can be the same image as
                                the destination, but if different, it must be exactly the same
                                size and format.
        @param destinationArea  the region of the image to apply the filter to
    */
    void applyToImage (Image& destImage,
                       const Image& sourceImage,
                       const Rectangle<int>& destinationArea) const;

Could someone please take a look?

Thanks.