memset(pbBufPtr(&s->pb), 0, n);
if(n>0) memset(pbBufPtr(&s->pb), 0, n);
static int output_frame_end(AC3EncodeContext *s){    int frame_size, frame_size_58, n, crc1, crc2, crc_inv;    uint8_t *frame;    frame_size = s->frame_size; /* frame size in words */    /* align to 8 bits */    flush_put_bits(&s->pb);    /* add zero bytes to reach the frame size */    frame = s->pb.buf;    n = 2 * s->frame_size - (pbBufPtr(&s->pb) - frame) - 2;    assert(n >= 0);    memset(pbBufPtr(&s->pb), 0, n);        /* Now we must compute both crcs : this is not so easy for crc1       because it is at the beginning of the data... */    frame_size_58 = (frame_size >> 1) + (frame_size >> 3);    crc1 = ac3_crc(frame + 4, (2 * frame_size_58) - 4, 0);    /* XXX: could precompute crc_inv */    crc_inv = pow_poly((CRC16_POLY >> 1), (16 * frame_size_58) - 16, CRC16_POLY);    crc1 = mul_poly(crc_inv, crc1, CRC16_POLY);    frame[2] = crc1 >> 8;    frame[3] = crc1;        crc2 = ac3_crc(frame + 2 * frame_size_58, (frame_size - frame_size_58) * 2 - 2, 0);    frame[2*frame_size - 2] = crc2 >> 8;    frame[2*frame_size - 1] = crc2;    //    printf("n=%d frame_size=%d\n", n, frame_size);    return frame_size * 2;}