mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-12-26 11:17:44 +01:00
fix[mpp_bitput]: fix put bits overflow
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com> Change-Id: I5cdb119f39084ed682b426870c3cbb119530448f
This commit is contained in:
parent
467d6088eb
commit
af3d4c211d
1 changed files with 4 additions and 0 deletions
|
|
@ -46,6 +46,10 @@ void mpp_put_bits(BitputCtx_t *bp, RK_U64 invalue, RK_S32 lbits)
|
|||
bp->bvalue = invalue >> (64 - bp->bitpos); // low bits value
|
||||
bp->index++;
|
||||
}
|
||||
|
||||
if (bp->index >= bp->buflen)
|
||||
return;
|
||||
|
||||
bp->pbuf[bp->index] = bp->bvalue;
|
||||
bp->bitpos = (bp->bitpos + lbits) & 63;
|
||||
// mpp_log("bp->index = %d bp->bitpos = %d lbits = %d invalue 0x%x bp->hvalue 0x%x bp->lvalue 0x%x",bp->index,bp->bitpos,lbits, (RK_U32)invalue,(RK_U32)(bp->bvalue >> 32),(RK_U32)bp->bvalue);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue