summaryrefslogtreecommitdiff
path: root/libavcodec/pnmdec.c
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2013-07-29 00:49:44 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-08-03 15:00:20 +0200
commit34d48dac252f8bb38fb34ea29fcb6b5313016391 (patch)
treefa827e2459368ec9652fd71a928fef177ca0c1b9 /libavcodec/pnmdec.c
parent62738157dd54475194f9bfadbe80a45e32771931 (diff)
downloadffmpeg-34d48dac252f8bb38fb34ea29fcb6b5313016391.tar.gz
avcodec/pnmdec: support more pnm files
Fixes Ticket1897 Some hunks that have become unneeded due to previous changes removed by the commiter. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/pnmdec.c')
-rw-r--r--libavcodec/pnmdec.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/pnmdec.c b/libavcodec/pnmdec.c
index a7b91fd509..df9b5ee2e4 100644
--- a/libavcodec/pnmdec.c
+++ b/libavcodec/pnmdec.c
@@ -66,11 +66,15 @@ static int pnm_decode_frame(AVCodecContext *avctx, void *data,
n = avctx->width * 8;
components=4;
sample_len=16;
+ if (s->maxval < 65535)
+ upgrade = 2;
goto do_read;
case AV_PIX_FMT_RGB48:
n = avctx->width * 6;
components=3;
sample_len=16;
+ if (s->maxval < 65535)
+ upgrade = 2;
goto do_read;
case AV_PIX_FMT_RGBA:
n = avctx->width * 4;
@@ -81,6 +85,8 @@ static int pnm_decode_frame(AVCodecContext *avctx, void *data,
n = avctx->width * 3;
components=3;
sample_len=8;
+ if (s->maxval < 255)
+ upgrade = 1;
goto do_read;
case AV_PIX_FMT_GRAY8:
n = avctx->width;