# HG changeset patch # User Matti Hamalainen # Date 1528849369 -10800 # Node ID ae53df2156ed9d608db86021c1d63e786f20787a # Parent 523c1d1270d698b44de9fa18d29740018af20032 Add buffer expansion quirk to Boogie Down Paint decoder, as it seems to be needed. diff -r 523c1d1270d6 -r ae53df2156ed tools/lib64fmts.c --- a/tools/lib64fmts.c Wed Jun 13 03:01:53 2018 +0300 +++ b/tools/lib64fmts.c Wed Jun 13 03:22:49 2018 +0300 @@ -200,8 +200,15 @@ cfg.rleMarkerB = buf->data[8]; cfg.rleMarkerW = buf->data[9]; - if ((res = dmDecodeGenericRLEAlloc(&mem, - dmGrowBufConstCopyOffs(&tmp, buf, 10), &cfg)) != DMERR_OK) + // Boogie Down Paint apparently is broken and stores one byte less + // than it should in some cases so we need to do some crappy buffer + // expansion here .. + if (dmGrowBufCopyOffs(&tmp, buf, 10, 1) == NULL) + return DMERR_MALLOC; + + tmp.len = tmp.size; + + if ((res = dmDecodeGenericRLEAlloc(&mem, &tmp, &cfg)) != DMERR_OK) goto out; res = dmC64DecodeGenericBMP(img, &mem, fmt);