Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Aimar <fenrir@videolan.org>2011-10-01 02:45:00 +0400
committerMichael Niedermayer <michaelni@gmx.at>2011-10-01 04:41:40 +0400
commit113d7be62497c4e59db8f224fdb7f0a90cf17d03 (patch)
tree94cfd0f543a9341c72f82a3ebf8f1a3816b61884 /libavcodec/eacmv.c
parente9064c9ce8ed18c3a3aab61e58e663b8f5b0c551 (diff)
Prevent NULL dereferences when missing the reference frame in the Electronic Arts CMV decoder.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/eacmv.c')
-rw-r--r--libavcodec/eacmv.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libavcodec/eacmv.c b/libavcodec/eacmv.c
index a084106c45..3ac9cdaecb 100644
--- a/libavcodec/eacmv.c
+++ b/libavcodec/eacmv.c
@@ -110,9 +110,10 @@ static void cmv_decode_inter(CmvContext * s, const uint8_t *buf, const uint8_t *
}else{ /* inter using last frame as reference */
int xoffset = (buf[i] & 0xF) - 7;
int yoffset = ((buf[i] >> 4)) - 7;
- cmv_motcomp(s->frame.data[0], s->frame.linesize[0],
- s->last_frame.data[0], s->last_frame.linesize[0],
- x*4, y*4, xoffset, yoffset, s->avctx->width, s->avctx->height);
+ if (s->last_frame.data[0])
+ cmv_motcomp(s->frame.data[0], s->frame.linesize[0],
+ s->last_frame.data[0], s->last_frame.linesize[0],
+ x*4, y*4, xoffset, yoffset, s->avctx->width, s->avctx->height);
}
i++;
}