AES-256 example code encrypting multiple subsections of plaintext with the same initialization vector
It seems like that chunking the input text and encrypting each chunk using the same initialization vector is a bad idea


You are quite right to be concerned. It wouldn't only be a bad idea; it would be an absolutely dreadful one.  With OFB mode, reusing an IV would cause the same bitpattern to be exclusive-or'ed with the plaintext to form the ciphertext; hence if the attacker takes the two ciphertexts with the same IV and exclusive-or's them, they'll get the two plaintexts exclusive-or'ed together.  From that, it is often not that difficult to recover the original plaintexts (as real plaintexts often have enough redundancy to allow this).

However, that's not what's happening here.

As a part of its processing, aes_ofb_crypt updates the IV it was passed; hence calling it multiple times will cause it to use a different IV each time.  Hence, this problem is avoided (and so this code is safe).