1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

lavfi/paletteuse: check get_color return value

Fixes CID #1420396
This commit is contained in:
Timo Rothenpieler 2017-11-08 19:17:45 +01:00
parent 8bcf5840ea
commit 237ccd8a16

View File

@ -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);