• Pierre Bourdon's avatar
    blurhash_transcoder: prevent out-of-bound reads with <8bpp images (#20388) · 1659788d
    Pierre Bourdon authored
    The Blurhash library used by Mastodon requires an input encoded as 24
    bits raw RGB data. The conversion to raw RGB using Imagemagick did not
    previously specify the desired bit depth. In some situations, this leads
    Imagemagick to output in a pixel format using less bpp than expected.
    This then manifested as segfaults of the Sidekiq process due to
    out-of-bounds read, or potentially a (highly noisy) memory infoleak.
    
    Fixes #19235.
    1659788d