static const enum AVPixelFormat pixfmt_rgb24[] = {
- AV_PIX_FMT_BGR24, AV_PIX_FMT_RGB32, AV_PIX_FMT_NONE };
+ AV_PIX_FMT_BGR24, AV_PIX_FMT_0RGB32, AV_PIX_FMT_NONE };
typedef struct EightBpsContext {
AVCodecContext *avctx;
unsigned int dlen, p, row;
const unsigned char *lp, *dp, *ep;
unsigned char count;
+ unsigned int px_inc;
unsigned int planes = c->planes;
unsigned char *planemap = c->planemap;
int ret;
/* Set data pointer after line lengths */
dp = encoded + planes * (height << 1);
+ px_inc = planes + (avctx->pix_fmt == AV_PIX_FMT_0RGB32);
+
for (p = 0; p < planes; p++) {
/* Lines length pointer for this plane */
lp = encoded + p * (height << 1);
if ((count = *dp++) <= 127) {
count++;
dlen -= count + 1;
- if (pixptr_end - pixptr < count * planes)
+ if (pixptr_end - pixptr < count * px_inc)
break;
if (ep - dp < count)
return AVERROR_INVALIDDATA;
while (count--) {
*pixptr = *dp++;
- pixptr += planes;
+ pixptr += px_inc;
}
} else {
count = 257 - count;
- if (pixptr_end - pixptr < count * planes)
+ if (pixptr_end - pixptr < count * px_inc)
break;
while (count--) {
*pixptr = *dp;
- pixptr += planes;
+ pixptr += px_inc;
}
dp++;
dlen -= 2;