aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/pictordec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-02-10 18:31:05 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-02-10 18:31:05 +0100
commit478fc7f57bac966fcd916419336b349028c549ec (patch)
tree817bf6797d2b17de470449de2f527eeec5eb305a /libavcodec/pictordec.c
parentea1d8465e6eca582c09e2526f677033b62576fda (diff)
downloadffmpeg-478fc7f57bac966fcd916419336b349028c549ec.tar.gz
pictordec: fix cga palette index limit
Fixes out of array read Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/pictordec.c')
-rw-r--r--libavcodec/pictordec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/pictordec.c b/libavcodec/pictordec.c
index 7c8f7e9f36..69d23828b3 100644
--- a/libavcodec/pictordec.c
+++ b/libavcodec/pictordec.c
@@ -174,7 +174,7 @@ static int decode_frame(AVCodecContext *avctx,
npal = FFMIN(esize, 16);
for (i = 0; i < npal; i++) {
int pal_idx = bytestream2_get_byte(&s->g);
- palette[i] = ff_cga_palette[FFMIN(pal_idx, 16)];
+ palette[i] = ff_cga_palette[FFMIN(pal_idx, 15)];
}
} else if (etype == 3) {
npal = FFMIN(esize, 16);