diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2009-10-01 15:40:29 +0000 |
---|---|---|
committer | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2009-10-01 15:40:29 +0000 |
commit | 43d7c6118d64a8b2772e2d9e0c13413968e776f1 (patch) | |
tree | f5e7d4b37da6f22275c2cad19b404ee0e5dba362 /libavformat | |
parent | ec656755044d29e8f0b0a50ad1c9fd297bcae484 (diff) | |
download | ffmpeg-43d7c6118d64a8b2772e2d9e0c13413968e776f1.tar.gz |
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.
Originally committed as revision 20124 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/mpegenc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/mpegenc.c b/libavformat/mpegenc.c index df4c9919a4..a471b38bb9 100644 --- a/libavformat/mpegenc.c +++ b/libavformat/mpegenc.c @@ -89,7 +89,7 @@ static int put_pack_header(AVFormatContext *ctx, 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 @@ static int put_system_header(AVFormatContext *ctx, uint8_t *buf,int only_for_str 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); |