On Wed, 14 Nov 2012 03:42:37 -0500, Xi Wang <xi.w...@gmail.com> wrote:
> 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.w...@gmail.com>
> ---
> See "CD+G Revealed", section "Scroll Copy (subCode.instruction==24)".
> 
> http://jbum.com/cdg_revealed.html
> 
>   SCmd = (vScroll & 0x30) >> 4;
>   VOffset = (vScroll & 0x0F);
> 
>       SCmd is a scrolliing instruction, which is either 0, 1 or 2.
>               0 means don't scroll
>               1 means scroll 12 pixels down,
>               2 means scroll 12 pixels up.
> 
>       VOffset is a vertical offset which is used for offsetting the graphic
>       display by amounts less than 12 pixels. It can assume values from 0 to 
> 11.
> ---
>  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;
> -- 
> 1.7.10.4
> 

LGTM, queueing.

-- 
Anton Khirnov
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to