Mercurial > libavformat.hg
changeset 5244:8c0b5c6d0f17 libavformat
put_bits can only reliably write up to 31 bit bits, above it relies on
undefined shift behaviour.
Document this, fix the assert and add a put_bits32 to handle writing 32
bits and use that where necessary.
author | reimar |
---|---|
date | Thu, 01 Oct 2009 15:40:29 +0000 |
parents | 13dd683f3ff2 |
children | 30c093f11b4e |
files | mpegenc.c |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mpegenc.c Thu Oct 01 10:24:02 2009 +0000 +++ b/mpegenc.c Thu Oct 01 15:40:29 2009 +0000 @@ -89,7 +89,7 @@ init_put_bits(&pb, buf, 128); - put_bits(&pb, 32, PACK_START_CODE); + put_bits32(&pb, PACK_START_CODE); if (s->is_mpeg2) { put_bits(&pb, 2, 0x1); } else { @@ -125,7 +125,7 @@ init_put_bits(&pb, buf, 128); - put_bits(&pb, 32, SYSTEM_HEADER_START_CODE); + put_bits32(&pb, SYSTEM_HEADER_START_CODE); put_bits(&pb, 16, 0); put_bits(&pb, 1, 1);