[FFmpeg-cvslog] lavfi/testsrc2: fix hang with very small sizes.

Nicolas George git at videolan.org
Tue Oct 31 10:49:00 EET 2017


ffmpeg | branch: master | Nicolas George <george at nsup.org> | Mon Oct 30 10:04:55 2017 +0100| [a8305b0ea3ccfe00a50cd3312bfcc455c78aacb5] | committer: Nicolas George

lavfi/testsrc2: fix hang with very small sizes.

Move a subtraction to the other side of the equal to avoid overflows.

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

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

diff --git a/libavfilter/vsrc_testsrc.c b/libavfilter/vsrc_testsrc.c
index fe0d50aa41..a790974d14 100644
--- a/libavfilter/vsrc_testsrc.c
+++ b/libavfilter/vsrc_testsrc.c
@@ -857,8 +857,8 @@ static void test2_fill_picture(AVFilterContext *ctx, AVFrame *frame)
         uint8_t alpha[256];
 
         r = s->pts;
-        for (y = ymin; y < ymax - 15; y += 16) {
-            for (x = xmin; x < xmax - 15; x += 16) {
+        for (y = ymin; y + 15 < ymax; y += 16) {
+            for (x = xmin; x + 15 < xmax; x += 16) {
                 if ((x ^ y) & 16)
                     continue;
                 for (i = 0; i < 256; i++) {



More information about the ffmpeg-cvslog mailing list