summaryrefslogtreecommitdiff
path: root/libavcodec/h263.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2004-03-26 21:58:55 +0000
committerMichael Niedermayer <michaelni@gmx.at>2004-03-26 21:58:55 +0000
commit5cce4dd761aafa8ff26f5262085449f40314a0e3 (patch)
treeab98e195904f1a92bc90d5fb0b51bd3293216cf5 /libavcodec/h263.c
parent38100e8c8d5c0b5c48cb9e00d298e1940d5ad89b (diff)
ensure that the bitstream buffers for encoding partitioned frames are aligned
Originally committed as revision 2935 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h263.c')
-rw-r--r--libavcodec/h263.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/libavcodec/h263.c b/libavcodec/h263.c
index ab10a693be..f2605c5fab 100644
--- a/libavcodec/h263.c
+++ b/libavcodec/h263.c
@@ -2996,13 +2996,12 @@ void ff_mpeg4_init_partitions(MpegEncContext *s)
uint8_t *start= pbBufPtr(&s->pb);
uint8_t *end= s->pb.buf_end;
int size= end - start;
- int pb_size = size/3;
- int pb2_size= size/3;
- int tex_size= size - pb_size - pb2_size;
+ int pb_size = (size/3)&(~1);
+ int tex_size= size - 2*pb_size;
set_put_bits_buffer_size(&s->pb, pb_size);
init_put_bits(&s->tex_pb, start + pb_size , tex_size);
- init_put_bits(&s->pb2 , start + pb_size + tex_size, pb2_size);
+ init_put_bits(&s->pb2 , start + pb_size + tex_size, pb_size);
}
void ff_mpeg4_merge_partitions(MpegEncContext *s)