mirror of https://git.ffmpeg.org/ffmpeg.git
avcodec/rv60: prevent decode_cu_r segfault
Fixes ticket #11289 (crash).
This commit is contained in:
parent
923f45430c
commit
4d4d171afb
|
@ -2355,6 +2355,8 @@ static int rv60_decode_frame(AVCodecContext *avctx, AVFrame * frame,
|
|||
ofs = get_bits_count(&gb) / 8;
|
||||
|
||||
for (int i = 0; i < s->cu_height; i++) {
|
||||
if (header_size + ofs >= avpkt->size)
|
||||
return AVERROR_INVALIDDATA;
|
||||
s->slice[i].data = avpkt->data + header_size + ofs;
|
||||
s->slice[i].data_size = FFMIN(s->slice[i].size, avpkt->size - header_size - ofs);
|
||||
ofs += s->slice[i].size;
|
||||
|
|
Loading…
Reference in New Issue