libtheora: Check memory allocation