Commit 3b57bb47 authored by Michael Niedermayer's avatar Michael Niedermayer

svq1dec: check that the reference frame matches in size before using it.

Fixes out of array reads

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent dbf0a905
...@@ -692,7 +692,7 @@ static int svq1_decode_frame(AVCodecContext *avctx, void *data, ...@@ -692,7 +692,7 @@ 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->cur->width || s->prev->height != s->cur->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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment