[FFmpeg-cvslog] vc1dec: prevent null ptr dereferences.
Michael Niedermayer
git at videolan.org
Mon Nov 12 01:53:15 CET 2012
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Nov 12 01:39:13 2012 +0100| [3a04c18d899d278eea551c216e5117974063062b] | committer: Michael Niedermayer
vc1dec: prevent null ptr dereferences.
The added checks are in line with existing checks but should
probably be replaced by more advanced error concealment at some
point.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3a04c18d899d278eea551c216e5117974063062b
---
libavcodec/vc1dec.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index 488892c..d9797d5 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -395,6 +395,9 @@ static void vc1_mc_1mv(VC1Context *v, int dir)
}
}
+ if(!srcY)
+ return;
+
src_x = s->mb_x * 16 + (mx >> 2);
src_y = s->mb_y * 16 + (my >> 2);
uvsrc_x = s->mb_x * 8 + (uvmx >> 2);
@@ -570,6 +573,9 @@ static void vc1_mc_4mv_luma(VC1Context *v, int n, int dir)
} else
srcY = s->next_picture.f.data[0];
+ if(!srcY)
+ return;
+
if (v->field_mode) {
if (v->cur_field_type != v->ref_field_type[dir])
my = my - 2 + 4 * v->cur_field_type;
@@ -859,6 +865,9 @@ static void vc1_mc_4mv_chroma(VC1Context *v, int dir)
srcV = s->next_picture.f.data[2];
}
+ if(!srcU)
+ return;
+
srcU += uvsrc_y * s->uvlinesize + uvsrc_x;
srcV += uvsrc_y * s->uvlinesize + uvsrc_x;
More information about the ffmpeg-cvslog
mailing list