summaryrefslogtreecommitdiff
path: root/libavcodec/xpmdec.c
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <ceffmpeg@gmail.com>2018-12-06 19:09:56 +0100
committerCarl Eugen Hoyos <ceffmpeg@gmail.com>2018-12-10 20:59:08 +0100
commitfe300b2ab5d137bfd012060ff7ae50321ae8ac12 (patch)
treefcb78f7df3182c7b49331379dd0afe391d286294 /libavcodec/xpmdec.c
parent8affd753c86d7e2ddefd24beafe4e892914c63bc (diff)
downloadffmpeg-fe300b2ab5d137bfd012060ff7ae50321ae8ac12.tar.gz
lavc/xpmdec: Allow more colours per character.
Fixes ticket #6234.
Diffstat (limited to 'libavcodec/xpmdec.c')
-rw-r--r--libavcodec/xpmdec.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/xpmdec.c b/libavcodec/xpmdec.c
index 03172e4aad..1aa40c0655 100644
--- a/libavcodec/xpmdec.c
+++ b/libavcodec/xpmdec.c
@@ -290,10 +290,10 @@ static int ascii2index(const uint8_t *cpixel, int cpp)
int n = 0, m = 1, i;
for (i = 0; i < cpp; i++) {
- if (*p < ' ' || *p > '~')
+ if (*p < ' ' || *p > 0xfe)
return AVERROR_INVALIDDATA;
n += (*p++ - ' ') * m;
- m *= 95;
+ m *= 220;
}
return n;
}
@@ -346,7 +346,7 @@ static int xpm_decode_frame(AVCodecContext *avctx, void *data,
size = 1;
for (i = 0; i < cpp; i++)
- size *= 95;
+ size *= 220;
if (ncolors <= 0 || ncolors > size) {
av_log(avctx, AV_LOG_ERROR, "invalid number of colors: %d\n", ncolors);