aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/xpmdec.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2017-03-12 22:58:49 +0100
committerPaul B Mahol <onemda@gmail.com>2017-03-12 23:03:02 +0100
commit58f0bbc1eafbe21197bc53ad263005093182a7f2 (patch)
tree7534e3e0f40633a652f82e632255b7a2615403b8 /libavcodec/xpmdec.c
parentdd0090eb211219377bf43a034749d8e6524015eb (diff)
downloadffmpeg-58f0bbc1eafbe21197bc53ad263005093182a7f2.tar.gz
avcodec/xpmdec: avoid "magic" numbers in function hex_char_to_number()
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavcodec/xpmdec.c')
-rw-r--r--libavcodec/xpmdec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/xpmdec.c b/libavcodec/xpmdec.c
index b9b2551ec1..605a09d05a 100644
--- a/libavcodec/xpmdec.c
+++ b/libavcodec/xpmdec.c
@@ -188,9 +188,9 @@ static const ColorEntry color_table[] = {
static unsigned hex_char_to_number(uint8_t x)
{
if (x >= 'a' && x <= 'f')
- x -= 87;
+ x -= 'a' - 10;
else if (x >= 'A' && x <= 'F')
- x -= 55;
+ x -= 'A' - 10;
else if (x >= '0' && x <= '9')
x -= '0';
else