mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-13 21:28:01 +02:00
avcodec/sunrast: Check for availability of maplength before allocating image
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 711ad71aea
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
878ba99316
commit
3a45323c97
@ -100,14 +100,14 @@ static int sunrast_decode_frame(AVCodecContext *avctx, void *data,
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
if (buf_end - buf < maplength)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
|
||||
return ret;
|
||||
|
||||
p->pict_type = AV_PICTURE_TYPE_I;
|
||||
|
||||
if (buf_end - buf < maplength)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
if (depth > 8 && maplength) {
|
||||
av_log(avctx, AV_LOG_WARNING, "useless colormap found or file is corrupted, trying to recover\n");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user