mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-24 03:39:45 +00:00
svq1dec: check that the reference frame has the same dimensions as the current one
They can be different if the last keyframe failed to decode correctly. Fixes possible invalid reads in such a case. Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC:libav-stable@libav.org
This commit is contained in:
parent
c0771a1ac6
commit
b1bb8fb860
@ -689,7 +689,8 @@ static int svq1_decode_frame(AVCodecContext *avctx, void *data,
|
|||||||
} else {
|
} else {
|
||||||
/* delta frame */
|
/* delta frame */
|
||||||
uint8_t *previous = s->prev->data[i];
|
uint8_t *previous = s->prev->data[i];
|
||||||
if (!previous) {
|
if (!previous ||
|
||||||
|
s->prev->width != s->width || s->prev->height != s->height) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "Missing reference frame.\n");
|
av_log(avctx, AV_LOG_ERROR, "Missing reference frame.\n");
|
||||||
result = AVERROR_INVALIDDATA;
|
result = AVERROR_INVALIDDATA;
|
||||||
goto err;
|
goto err;
|
||||||
|
Loading…
Reference in New Issue
Block a user