return AVERROR_INVALIDDATA;
}
- s->planesize = avctx->width >> 3;
+ s->planesize = FFALIGN(avctx->width, 16) >> 3; // Align plane size in bits to word-boundary
s->planebuf = av_malloc(s->planesize + FF_INPUT_BUFFER_PADDING_SIZE);
if (!s->planebuf)
return AVERROR(ENOMEM);
{
GetBitContext gb;
int i;
- const int b = (buf_size * 8) + bps - 1;
+ const int b = buf_size * 8;
init_get_bits(&gb, buf, buf_size * 8);
for(i = 0; i < b; i++) {
dst[i] |= get_bits1(&gb) << plane;
{
GetBitContext gb;
int i;
- const int b = (buf_size * 8) + bps - 1;
+ const int b = buf_size * 8;
init_get_bits(&gb, buf, buf_size * 8);
for(i = 0; i < b; i++) {
dst[i] |= get_bits1(&gb) << plane;