avcodec/rv60: prevent decode_cu_r segfault

Fixes ticket #11289 (crash).
master
Peter Ross 2 months ago
parent 923f45430c
commit 4d4d171afb
  1. 2
      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;

Loading…
Cancel
Save