diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2013-08-14 16:51:53 +0200 |
---|---|---|
committer | Sean McGovern <gseanmcg@gmail.com> | 2013-09-23 19:43:07 -0400 |
commit | 86c169c5b691ac8434056936a7690fc4c64b4b1a (patch) | |
tree | 6b8da4268d8753c14423b4c12e6480114cfaa427 | |
parent | 91355bec88ceb3622ea26f4d50126e6d5ea17d91 (diff) | |
download | ffmpeg-86c169c5b691ac8434056936a7690fc4c64b4b1a.tar.gz |
dxa: Make sure the reference frame exists
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 5ef7c84a9374681c64722a96d91741f3b990af2b)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Conflicts:
libavcodec/dxa.c
-rw-r--r-- | libavcodec/dxa.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/dxa.c b/libavcodec/dxa.c index 97b912a61a..632b1a477c 100644 --- a/libavcodec/dxa.c +++ b/libavcodec/dxa.c @@ -255,6 +255,12 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac case 5: c->pic.key_frame = !(compr & 1); c->pic.pict_type = (compr & 1) ? AV_PICTURE_TYPE_P : AV_PICTURE_TYPE_I; + + if (!tmpptr && !c->pic.key_frame) { + av_log(avctx, AV_LOG_ERROR, "Missing reference frame.\n"); + return AVERROR_INVALIDDATA; + } + for(j = 0; j < avctx->height; j++){ if(compr & 1){ for(i = 0; i < avctx->width; i++) |