Browse Source

avcodec/xpmdec: fix small artifacts

The max size of uint8_t subset is 223 not 220.
tags/n4.2
Paul B Mahol 7 years ago
parent
commit
00502370f6
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      libavcodec/xpmdec.c

+ 2
- 2
libavcodec/xpmdec.c View File

@@ -293,7 +293,7 @@ static int ascii2index(const uint8_t *cpixel, int cpp)
if (*p < ' ' || *p > 0xfe)
return AVERROR_INVALIDDATA;
n += (*p++ - ' ') * m;
m *= 220;
m *= 223;
}
return n;
}
@@ -346,7 +346,7 @@ static int xpm_decode_frame(AVCodecContext *avctx, void *data,

size = 1;
for (i = 0; i < cpp; i++)
size *= 220;
size *= 223;

if (ncolors <= 0 || ncolors > size) {
av_log(avctx, AV_LOG_ERROR, "invalid number of colors: %d\n", ncolors);


Loading…
Cancel
Save