summaryrefslogtreecommitdiff
path: root/libavcodec/eamad.c
diff options
context:
space:
mode:
authorLaurent Aimar <fenrir@videolan.org>2011-10-08 23:40:32 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-10-09 03:08:03 +0200
commit6e20554a6d33e92b81dc3cfed6082e03bff2a7f8 (patch)
tree36ef7e7e47a1f1eb8e0fea14b1a9d79ad42e33e0 /libavcodec/eamad.c
parent6bfe0d4c3d7de11e859ea6720b011cf5fdf5ef03 (diff)
eamad: avoid NULL derefence when missing the reference frame.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/eamad.c')
-rw-r--r--libavcodec/eamad.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/eamad.c b/libavcodec/eamad.c
index 60de780750..a092d473b5 100644
--- a/libavcodec/eamad.c
+++ b/libavcodec/eamad.c
@@ -205,7 +205,8 @@ static void decode_mb(MadContext *t, int inter)
for (j=0; j<6; j++) {
if (mv_map & (1<<j)) { // mv_x and mv_y are guarded by mv_map
int add = 2*decode_motion(&s->gb);
- comp_block(t, s->mb_x, s->mb_y, j, mv_x, mv_y, add);
+ if (t->last_frame.data[0])
+ comp_block(t, s->mb_x, s->mb_y, j, mv_x, mv_y, add);
} else {
s->dsp.clear_block(t->block);
decode_block_intra(t, t->block);