diff options
author | Peter Ross <pross@xvid.org> | 2024-11-07 10:27:06 +1100 |
---|---|---|
committer | Peter Ross <pross@xvid.org> | 2024-11-09 08:50:59 +1100 |
commit | 4d4d171afb2a13219920cb9b30d4304bf9d0f122 (patch) | |
tree | e300b86da452c6ba3aa0cb6ab7f52dff1cf073a8 | |
parent | 923f45430c3bb831d21c3cc52e721368c8a5a007 (diff) | |
download | ffmpeg-4d4d171afb2a13219920cb9b30d4304bf9d0f122.tar.gz |
avcodec/rv60: prevent decode_cu_r segfault
Fixes ticket #11289 (crash).
-rw-r--r-- | libavcodec/rv60dec.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/rv60dec.c b/libavcodec/rv60dec.c index 86c7aefbca..8ec95e896f 100644 --- a/libavcodec/rv60dec.c +++ b/libavcodec/rv60dec.c @@ -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; |