If the data for decrypting is too little, then you can run into this problem. I used a GNU parallel utility. Had this problem (error writing output file). Fixed it with adding min size for blocks using --blocksize. Also, openssl is kind of a weirdo, it returns this error on any problem I encountered (wrong password for decrypting once, wrong data for decrypting). So be aware.