Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-02-10 21:31:05 +0400
committerMichael Niedermayer <michaelni@gmx.at>2013-02-10 21:31:05 +0400
commit478fc7f57bac966fcd916419336b349028c549ec (patch)
tree817bf6797d2b17de470449de2f527eeec5eb305a /libavcodec/pictordec.c
parentea1d8465e6eca582c09e2526f677033b62576fda (diff)
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);