[FFmpeg-cvslog] videodsp: assert that linesize is larger than width

Michael Niedermayer git at videolan.org
Wed Jul 8 01:33:35 CEST 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Jul  8 00:49:04 2015 +0200| [b8c438e7623644edcfdb508c946a723a3b79b893] | committer: Michael Niedermayer

videodsp: assert that linesize is larger than width

Suggested-by: Andreas Cadhalpun <andreas.cadhalpun at googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b8c438e7623644edcfdb508c946a723a3b79b893
---

 libavcodec/videodsp_template.c |    2 ++
 libavcodec/x86/videodsp_init.c |    2 ++
 2 files changed, 4 insertions(+)

diff --git a/libavcodec/videodsp_template.c b/libavcodec/videodsp_template.c
index c569c30..94c1b71 100644
--- a/libavcodec/videodsp_template.c
+++ b/libavcodec/videodsp_template.c
@@ -32,6 +32,8 @@ void FUNC(ff_emulated_edge_mc)(uint8_t *buf, const uint8_t *src,
     if (!w || !h)
         return;
 
+    av_assert2(block_w * sizeof(pixel) <= FFABS(buf_linesize));
+
     if (src_y >= h) {
         src -= src_y * src_linesize;
         src += (h - 1) * src_linesize;
diff --git a/libavcodec/x86/videodsp_init.c b/libavcodec/x86/videodsp_init.c
index 885cdf1..26e072b 100644
--- a/libavcodec/x86/videodsp_init.c
+++ b/libavcodec/x86/videodsp_init.c
@@ -162,6 +162,8 @@ static av_always_inline void emulated_edge_mc(uint8_t *dst, const uint8_t *src,
     if (!w || !h)
         return;
 
+    av_assert2(block_w <= FFABS(dst_stride));
+
     if (src_y >= h) {
         src -= src_y*src_stride;
         src_y_add = h - 1;



More information about the ffmpeg-cvslog mailing list