summaryrefslogtreecommitdiff
path: root/libavformat/qtpalette.c
diff options
context:
space:
mode:
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2016-01-10 10:53:33 +0100
committerAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2016-01-11 23:14:52 +0100
commit63c9b30f98ce7d160b3a6dec1b36dc05fbb71941 (patch)
tree5d86b759b67580d8c2f870e5028dbbf2a2a0c6a8 /libavformat/qtpalette.c
parent59c915a403af32c4ff5126625b0cc7e38f4beff9 (diff)
qtpalette: make the color_* variables unsigned again
This fixes segmentation faults due to out of bounds writes, when color_start is interpreted as negative number. This regression was introduced in commit 57631f. Reviewed-by: Mats Peterson <matsp888@yahoo.com> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Diffstat (limited to 'libavformat/qtpalette.c')
-rw-r--r--libavformat/qtpalette.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/qtpalette.c b/libavformat/qtpalette.c
index a78b6af97a..666c6b7351 100644
--- a/libavformat/qtpalette.c
+++ b/libavformat/qtpalette.c
@@ -48,7 +48,7 @@ int ff_get_qtpalette(int codec_id, AVIOContext *pb, uint32_t *palette)
/* If the depth is 1, 2, 4, or 8 bpp, file is palettized. */
if ((bit_depth == 1 || bit_depth == 2 || bit_depth == 4 || bit_depth == 8)) {
- int color_count, color_start, color_end;
+ uint32_t color_count, color_start, color_end;
uint32_t a, r, g, b;
/* Ignore the greyscale bit for 1-bit video and sample