[FFmpeg-cvslog] avfilter/vsrc_testsrc: smpte(hd)bars: fix uninitialized last rows and columns of chroma planes

Paul B Mahol git at videolan.org
Mon Aug 10 11:30:15 CEST 2015


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Mon Aug 10 11:17:52 2015 +0200| [7a7ca3cc2f43e7a7b61fdad8200b365ff0977bd2] | committer: Paul B Mahol

avfilter/vsrc_testsrc: smpte(hd)bars: fix uninitialized last rows and columns of chroma planes

For cases width and/or height is not multiple of chroma subsamplings.

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

 libavfilter/vsrc_testsrc.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavfilter/vsrc_testsrc.c b/libavfilter/vsrc_testsrc.c
index 3f0da18..585288a 100644
--- a/libavfilter/vsrc_testsrc.c
+++ b/libavfilter/vsrc_testsrc.c
@@ -843,7 +843,7 @@ static const uint8_t black4[4] = {  25, 128, 128, 255 };
 static const uint8_t   neg2[4] = {  12, 128, 128, 255 };
 
 static void draw_bar(TestSourceContext *test, const uint8_t color[4],
-                     unsigned x, unsigned y, unsigned w, unsigned h,
+                     int x, int y, int w, int h,
                      AVFrame *frame)
 {
     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(frame->format);
@@ -865,9 +865,9 @@ static void draw_bar(TestSourceContext *test, const uint8_t color[4],
 
         if (plane == 1 || plane == 2) {
             px = x >> desc->log2_chroma_w;
-            pw = w >> desc->log2_chroma_w;
+            pw = FF_CEIL_RSHIFT(w, desc->log2_chroma_w);
             py = y >> desc->log2_chroma_h;
-            ph = h >> desc->log2_chroma_h;
+            ph = FF_CEIL_RSHIFT(h, desc->log2_chroma_h);
         } else {
             px = x;
             pw = w;



More information about the ffmpeg-cvslog mailing list