mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-27 13:10:37 +00:00
mss1: check number of free colours
Prevents out of array write. Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
parent
8a0cd58729
commit
e3c2670539
@ -783,6 +783,10 @@ static av_cold int mss1_decode_init(AVCodecContext *avctx)
|
||||
av_log(avctx, AV_LOG_DEBUG, "Encoder version %d.%d\n",
|
||||
AV_RB32(avctx->extradata + 4), AV_RB32(avctx->extradata + 8));
|
||||
c->free_colours = AV_RB32(avctx->extradata + 48);
|
||||
if (c->free_colours < 0 || c->free_colours > 256) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Invalid free colours %d\n", c->free_colours);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
av_log(avctx, AV_LOG_DEBUG, "%d free colour(s)\n", c->free_colours);
|
||||
avctx->coded_width = AV_RB32(avctx->extradata + 20);
|
||||
avctx->coded_height = AV_RB32(avctx->extradata + 24);
|
||||
|
Loading…
Reference in New Issue
Block a user