[FFmpeg-cvslog] cdgraphics: fix incorrect vertical offset mask in cdg_scroll()

Xi Wang git at videolan.org
Thu Nov 22 15:46:51 CET 2012


ffmpeg | branch: master | Xi Wang <xi.wang at gmail.com> | Wed Nov 14 03:42:37 2012 -0500| [0d3123666a42ed6c74d0a052342175261304b8ca] | committer: Anton Khirnov

cdgraphics: fix incorrect vertical offset mask in cdg_scroll()

The vertical offset mask 0x07 is suspicious.

    v_off = FFMIN(data[2] & 0x07, CDG_BORDER_HEIGHT - 1);

Note that v_off is up to 11 (CDG_BORDER_HEIGHT - 1), the correct mask
should be 0x0F.

Signed-off-by: Xi Wang <xi.wang at gmail.com>
Signed-off-by: Anton Khirnov <anton at khirnov.net>

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

 libavcodec/cdgraphics.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/cdgraphics.c b/libavcodec/cdgraphics.c
index 21de07e..631c415 100644
--- a/libavcodec/cdgraphics.c
+++ b/libavcodec/cdgraphics.c
@@ -218,7 +218,7 @@ static void cdg_scroll(CDGraphicsContext *cc, uint8_t *data,
     vscmd = (data[2] & 0x30) >> 4;
 
     h_off =  FFMIN(data[1] & 0x07, CDG_BORDER_WIDTH  - 1);
-    v_off =  FFMIN(data[2] & 0x07, CDG_BORDER_HEIGHT - 1);
+    v_off =  FFMIN(data[2] & 0x0F, CDG_BORDER_HEIGHT - 1);
 
     /// find the difference and save the offset for cdg_tile_block usage
     hinc = h_off - cc->hscroll;



More information about the ffmpeg-cvslog mailing list