summaryrefslogtreecommitdiffstats
path: root/libavfilter/vf_paletteuse.c
diff options
context:
space:
mode:
authorTimo Rothenpieler <timo@rothenpieler.org>2017-11-08 19:17:45 +0100
committerTimo Rothenpieler <timo@rothenpieler.org>2017-11-13 20:33:10 +0100
commit237ccd8a165d2128e8c6bcb14c8c6c3e793cfe05 (patch)
tree4bb2bfcf1241abac54dfd8b8f46eb84c58ac0d26 /libavfilter/vf_paletteuse.c
parent8bcf5840ea2a6a92c75ab3219f89fe0b8a53cf50 (diff)
downloadffmpeg-streaming-237ccd8a165d2128e8c6bcb14c8c6c3e793cfe05.zip
ffmpeg-streaming-237ccd8a165d2128e8c6bcb14c8c6c3e793cfe05.tar.gz
lavfi/paletteuse: check get_color return value
Fixes CID #1420396
Diffstat (limited to 'libavfilter/vf_paletteuse.c')
-rw-r--r--libavfilter/vf_paletteuse.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavfilter/vf_paletteuse.c b/libavfilter/vf_paletteuse.c
index ed80ab0..1980907 100644
--- a/libavfilter/vf_paletteuse.c
+++ b/libavfilter/vf_paletteuse.c
@@ -380,8 +380,11 @@ static av_always_inline int get_dst_color_err(PaletteUseContext *s,
const uint8_t r = c >> 16 & 0xff;
const uint8_t g = c >> 8 & 0xff;
const uint8_t b = c & 0xff;
+ uint32_t dstc;
const int dstx = color_get(s, c, a, r, g, b, search_method);
- const uint32_t dstc = s->palette[dstx];
+ if (dstx < 0)
+ return dstx;
+ dstc = s->palette[dstx];
*er = r - (dstc >> 16 & 0xff);
*eg = g - (dstc >> 8 & 0xff);
*eb = b - (dstc & 0xff);
OpenPOWER on IntegriCloud