[libav-stable] mpegvideo: fix loop condition in draw_line()

Xi Wang git at libav.org
Sat Jan 19 22:21:21 CET 2013


Module: libav
Branch: master
Commit: 992b03183819553a73b4f870a710ef500b4eb6d0

Author:    Xi Wang <xi.wang at gmail.com>
Committer: Luca Barbato <lu_zero at gentoo.org>
Date:      Sat Jan 19 13:21:35 2013 -0500

mpegvideo: fix loop condition in draw_line()

The loop condition `x = ex' is incorrect.  It should be `x <= ex'.

This bug was introduced in commit c65dfac4 "mpegvideo.c: K&R formatting
and cosmetics."

CC:libav-stable at libav.org

Signed-off-by: Luca Barbato <lu_zero at gentoo.org>

---

 libavcodec/mpegvideo.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 5bb04dd..ce36610 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -1659,7 +1659,7 @@ static void draw_line(uint8_t *buf, int sx, int sy, int ex, int ey,
         buf += sx + sy * stride;
         ex  -= sx;
         f    = ((ey - sy) << 16) / ex;
-        for (x = 0; x = ex; x++) {
+        for (x = 0; x <= ex; x++) {
             y  = (x * f) >> 16;
             fr = (x * f) & 0xFFFF;
             buf[y * stride + x]       += (color * (0x10000 - fr)) >> 16;



More information about the libav-stable mailing list