mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-23 11:19:55 +00:00
avformat/ipmovie: Check palette size in OPCODE_SET_PALETTE
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
947e40b9fe
commit
4e575adeff
@ -465,7 +465,8 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb,
|
|||||||
first_color = AV_RL16(&scratch[0]);
|
first_color = AV_RL16(&scratch[0]);
|
||||||
last_color = first_color + AV_RL16(&scratch[2]) - 1;
|
last_color = first_color + AV_RL16(&scratch[2]) - 1;
|
||||||
/* sanity check (since they are 16 bit values) */
|
/* sanity check (since they are 16 bit values) */
|
||||||
if ((first_color > 0xFF) || (last_color > 0xFF)) {
|
if ( (first_color > 0xFF) || (last_color > 0xFF)
|
||||||
|
|| (last_color - first_color + 1)*3 + 4 > opcode_size) {
|
||||||
av_dlog(NULL, "demux_ipmovie: set_palette indexes out of range (%d -> %d)\n",
|
av_dlog(NULL, "demux_ipmovie: set_palette indexes out of range (%d -> %d)\n",
|
||||||
first_color, last_color);
|
first_color, last_color);
|
||||||
chunk_type = CHUNK_BAD;
|
chunk_type = CHUNK_BAD;
|
||||||
|
Loading…
Reference in New Issue
Block a user