Fix bad rendering of AV_PIX_FMT_PAL8 (palette-ised) images (#1426). v2.13.83
authorCarl Hetherington <cth@carlh.net>
Wed, 12 Dec 2018 00:40:19 +0000 (00:40 +0000)
committerCarl Hetherington <cth@carlh.net>
Wed, 12 Dec 2018 00:40:19 +0000 (00:40 +0000)
src/lib/image.cc

index dffc00e0ea2ed6d1e101f1711035dd22bef9d67a..41582f307b30b23bce02603aad7c9f74bae1f6f0 100644 (file)
@@ -106,6 +106,10 @@ Image::planes () const
                throw PixelFormatError ("planes()", _pixel_format);
        }
 
+       if (_pixel_format == AV_PIX_FMT_PAL8) {
+               return 2;
+       }
+
        if ((d->flags & AV_PIX_FMT_FLAG_PLANAR) == 0) {
                return 1;
        }